33 lines
583 B
PHP
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();
|
||
|
}
|
||
|
}
|