20 lines
385 B
PHP
20 lines
385 B
PHP
|
|
<?php
|
||
|
|
|
||
|
|
namespace App\Modules\Client\Actions;
|
||
|
|
|
||
|
|
use App\Modules\Client\Models\Client;
|
||
|
|
use Illuminate\Contracts\Pagination\LengthAwarePaginator;
|
||
|
|
|
||
|
|
final class GetClientAction
|
||
|
|
{
|
||
|
|
public function list(): LengthAwarePaginator
|
||
|
|
{
|
||
|
|
return Client::orderBy('name')->paginate(50);
|
||
|
|
}
|
||
|
|
|
||
|
|
public function find(int $id): Client
|
||
|
|
{
|
||
|
|
return Client::findOrFail($id);
|
||
|
|
}
|
||
|
|
}
|