applicant-site/app/Http/Requests/admin/Catalog/Direction/UpdateSubjectRequest.php

34 lines
772 B
PHP
Raw Normal View History

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',
'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}",
],
];
}
}