Leonid Nikitin b7d0a2453e
Moved from "app/src" to "app/application".
Otherwise phpstorm doesn't understand the paths correctly. He thinks that this is not a complete application, but a package. And when creating a class, the namespace indicates “app” with a small letter, but should be “App”.
2024-04-11 19:52:37 +05:00

31 lines
743 B
PHP

<?php declare(strict_types=1);
namespace App\Http\Requests\Admin\Projects;
use App\Contracts\FormRequestDto;
use App\Dto\Builder\Project;
use App\Dto\Service\Admin\Project\Index;
use Illuminate\Foundation\Http\FormRequest;
final class IndexRequest extends FormRequest implements FormRequestDto
{
/**
* Get the validation rules that apply to the request.
*/
public function rules(): array
{
$this->redirect = route('admin.projects.index');
return [
'page' => ['nullable', 'numeric', 'min:1']
];
}
public function getDto(): Index
{
return new Index(
projectBuilderDto: new Project(),
page: (int) $this->input('page', 1)
);
}
}