2024-02-17 11:30:32 +03:00
|
|
|
<?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',
|
2024-03-12 13:50:42 +03:00
|
|
|
'description' => 'nullable|string',
|
2024-02-17 11:30:32 +03:00
|
|
|
'slug' => [
|
|
|
|
'string',
|
|
|
|
'required',
|
|
|
|
'max:255',
|
|
|
|
"unique:subjects,slug,{$this->subject->id}",
|
|
|
|
],
|
|
|
|
'name' => [
|
|
|
|
'required',
|
|
|
|
'string',
|
|
|
|
'max:255',
|
|
|
|
"unique:subjects,name,{$this->subject->id}",
|
|
|
|
],
|
|
|
|
];
|
|
|
|
}
|
|
|
|
}
|