24 lines
443 B
PHP
24 lines
443 B
PHP
<?php
|
|
|
|
namespace App\Services;
|
|
|
|
use App\Models\Example;
|
|
|
|
class ExampleService extends Service
|
|
{
|
|
public static function store($params)
|
|
{
|
|
return (Example::create($params))->fresh();
|
|
}
|
|
|
|
public static function update($id, $params)
|
|
{
|
|
return (tap(Example::findOrFail($id))->update($params))->fresh();
|
|
}
|
|
|
|
public static function destroy($id)
|
|
{
|
|
return Example::findOrFail($id)->delete();
|
|
}
|
|
}
|