39 lines
1.0 KiB
PHP
39 lines
1.0 KiB
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',
|
|
"unique:directions,slug,{$this->direction->id}",
|
|
],
|
|
'name' => 'required|string|max:255',
|
|
'education_level_id' => 'required|int|numeric|max:1000',
|
|
'education_form_id' => 'required|int|numeric|max:1000',
|
|
'code' => [
|
|
'required',
|
|
'string',
|
|
'max:255',
|
|
"unique:directions,code,{$this->direction->id}",
|
|
],
|
|
];
|
|
}
|
|
}
|