34 lines
772 B
PHP
34 lines
772 B
PHP
<?php
|
|
|
|
namespace App\Http\Requests\admin\Catalog\Direction;
|
|
|
|
use Illuminate\Foundation\Http\FormRequest;
|
|
|
|
class UpdateSubjectRequest extends FormRequest
|
|
{
|
|
public function authorize(): bool
|
|
{
|
|
return true;
|
|
}
|
|
|
|
public function rules(): array
|
|
{
|
|
return [
|
|
'position' => 'required|int|numeric|max:255',
|
|
'description' => 'nullable|string',
|
|
'slug' => [
|
|
'string',
|
|
'required',
|
|
'max:255',
|
|
"unique:subjects,slug,{$this->subject->id}",
|
|
],
|
|
'name' => [
|
|
'required',
|
|
'string',
|
|
'max:255',
|
|
"unique:subjects,name,{$this->subject->id}",
|
|
],
|
|
];
|
|
}
|
|
}
|