Roman_applicant-site/app/Http/Requests/admin/Catalog/UpdateDirectionRequest.php

34 lines
930 B
PHP

<?php
namespace App\Http\Requests\admin\Catalog;
use Illuminate\Contracts\Validation\ValidationRule;
use Illuminate\Foundation\Http\FormRequest;
class UpdateDirectionRequest extends FormRequest
{
public function authorize(): bool
{
return true;
}
public function rules(): array
{
return [
'position' => 'required||numeric|int|max:255',
'description' => 'string',
'department_id' => 'int|required|numeric|max:1000',
'slug' => 'required|string|max:255',
'code' => 'required|string|max:255',
'education_level_id' => 'required|int|numeric|max:1000',
'education_form_id' => 'required|int|numeric|max:1000',
'name' => [
'required',
'string',
'max:255',
"unique:directions,name,{$this->direction->id}",
],
];
}
}