⚝
One Hat Cyber Team
⚝
Your IP:
216.73.216.229
Server IP:
95.217.99.93
Server:
Linux sv1.sonichosted.com 4.18.0-553.34.1.lve.el8.x86_64 #1 SMP Thu Jan 9 16:30:32 UTC 2025 x86_64
Server Software:
LiteSpeed
PHP Version:
8.2.29
Buat File
|
Buat Folder
Eksekusi
Dir :
~
/
home
/
lifestylescentra
/
public_html
/
app
/
Services
/
View File Name :
WorkoutCategoryService.php
<?php namespace App\Services; use App\Models\WorkoutCategory; use Illuminate\Database\Eloquent\Collection; class WorkoutCategoryService { /** * Get all workout categories * * @return \Illuminate\Database\Eloquent\Collection */ public function getAllWorkoutCategories(): Collection { return WorkoutCategory::all(); } /** * Get workout category by id * * @param int $id * @return \App\Models\WorkoutCategory */ public function getWorkoutCategoryById(int $id) { return WorkoutCategory::find($id); } /** * Create workout category * * @param array<string, mixed> $data * @return \App\Models\WorkoutCategory */ public function createWorkoutCategory(array $data) { return WorkoutCategory::create($data); } /** * Update workout category * * @param \App\Models\WorkoutCategory $workoutCategory * @param array<string, mixed> $data * @return \App\Models\WorkoutCategory */ public function updateWorkoutCategory(WorkoutCategory $workoutCategory, array $data) { $workoutCategory->update($data); return $workoutCategory; } /** * Delete workout category * * @param \App\Models\WorkoutCategory $workoutCategory * @return bool */ public function deleteWorkoutCategory(WorkoutCategory $workoutCategory) { return $workoutCategory->delete(); } }