33 lines
862 B
PHP
33 lines
862 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',
|
|
'name' => [
|
|
'required',
|
|
'string',
|
|
'max:255',
|
|
"unique:directions,name,{$this->direction->id}",
|
|
],
|
|
];
|
|
}
|
|
}
|