CourseWork/app/Services/GradeService.php
2024-04-23 14:52:49 +04:00

33 lines
583 B
PHP

<?php
namespace App\Services;
use App\Models\Grade;
use Illuminate\Pagination\LengthAwarePaginator;
class GradeService implements ServiceInterface
{
public function getAll(): LengthAwarePaginator
{
return Grade::filter()->paginate(10)->withQueryString();
}
public function create(array $data): Grade
{
return Grade::create($data);
}
public function update($model, array $data): Grade
{
$model->update($data);
return $model;
}
public function delete($model): void
{
$model->delete();
}
}