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

34 lines
763 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' => 'string',
'slug' => [
'string',
'required',
'max:255',
"unique:subjects,slug,{$this->subject->id}",
],
'name' => [
'required',
'string',
'max:255',
"unique:subjects,name,{$this->subject->id}",
],
];
}
}