28 lines
592 B
PHP
28 lines
592 B
PHP
<?php declare(strict_types=1);
|
|
|
|
namespace App\Http\Requests\Site\User;
|
|
|
|
use App\Contracts\FormRequestDto;
|
|
use App\Dto\Service\Site\User\User;
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UserRequest extends FormRequest implements FormRequestDto
|
|
{
|
|
/**
|
|
* Get the validation rules that apply to the request.
|
|
*/
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'page' => ['nullable', 'numeric', 'min:1']
|
|
];
|
|
}
|
|
|
|
public function getDto(): User
|
|
{
|
|
return new User(
|
|
page: (int) $this->input('page', 1)
|
|
);
|
|
}
|
|
}
|