forked from aslan/applicant-site
refactoring fix unique field slug in Requests
This commit is contained in:
parent
9beeeb4edb
commit
23033cbb1f
|
@ -18,7 +18,7 @@ class StoreDepartmentRequest extends FormRequest
|
|||
'position' => 'required|int|numeric|max:255',
|
||||
'name' => 'required|string|max:255|unique:departments,name',
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => 'required|string|max:255|unique:departments,slug',
|
||||
'faculty_id' => 'required|numeric|int|max:1000',
|
||||
];
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ class StoreDirectionRequest extends FormRequest
|
|||
'position' => 'required|int|numeric|max:255',
|
||||
'name' => 'required|string|max:255|unique:directions,name',
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => 'required|string|max:255|unique:directions,slug',
|
||||
'code' => 'required|string|max:255',
|
||||
'education_level_id' => 'required|int|numeric|max:1000',
|
||||
'education_form_id' => 'required|int|numeric|max:1000',
|
||||
|
|
|
@ -16,7 +16,7 @@ class StoreEducationFormRequest extends FormRequest
|
|||
return [
|
||||
'name' => 'required|string|max:255|unique:education_levels,name',
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => 'required|string|max:255|unique:education_levels,slug',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class StoreEducationLevelRequest extends FormRequest
|
|||
return [
|
||||
'name' => 'required|string|max:255|unique:education_levels,name',
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => 'required|string|max:255|unique:education_levels,slug',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,7 @@ class StoreEducationalInstitutionRequest extends FormRequest
|
|||
'position' => 'required|int|numeric|max:255',
|
||||
'name' => 'required|string|max:255|unique:educational_institutions,name',
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => 'required|string|max:255|unique:educational_institutions,slug',
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -18,7 +18,7 @@ class StoreFacultyRequest extends FormRequest
|
|||
'position' => 'required|int|numeric|max:255',
|
||||
'name' => 'required|string|max:255|unique:faculties,name',
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => 'required|string|max:255|unique:faculties,slug',
|
||||
'educational_institution_id' => 'required|int|numeric|max:1000'
|
||||
];
|
||||
}
|
||||
|
|
|
@ -15,7 +15,12 @@ class UpdateDepartmentRequest extends FormRequest
|
|||
return [
|
||||
'position' => 'required|int|numeric|max:255',
|
||||
'description' => 'string',
|
||||
'slug' => 'string|required|max:255',
|
||||
'slug' => [
|
||||
'string',
|
||||
'required',
|
||||
'max:255',
|
||||
"unique:departments,slug,{$this->department->id}",
|
||||
],
|
||||
'faculty_id' => 'int|required|numeric|max:255',
|
||||
'name' => [
|
||||
'required',
|
||||
|
|
|
@ -18,7 +18,12 @@ class UpdateDirectionRequest extends FormRequest
|
|||
'position' => 'required||numeric|int|max:255',
|
||||
'description' => 'string',
|
||||
'department_id' => 'int|required|numeric|max:1000',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => [
|
||||
'required',
|
||||
'string',
|
||||
'max:255',
|
||||
"unique:directions,slug,{$this->direction->id}",
|
||||
],
|
||||
'code' => 'required|string|max:255',
|
||||
'education_level_id' => 'required|int|numeric|max:1000',
|
||||
'education_form_id' => 'required|int|numeric|max:1000',
|
||||
|
|
|
@ -16,7 +16,7 @@ class UpdateEducationFormRequest extends FormRequest
|
|||
return [
|
||||
'name' => "required|string|max:255|unique:education_forms,name,{$this->education_form->id}",
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => "required|string|max:255|unique:education_forms,slug,{$this->education_form->id}",
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,7 +16,7 @@ class UpdateEducationLevelRequest extends FormRequest
|
|||
return [
|
||||
'name' => "required|string|max:255|unique:education_levels,name,{$this->education_level->id}",
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => "required|string|max:255|unique:education_levels,slug,{$this->education_level->id}",
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,7 +17,12 @@ class UpdateEducationalInstitutionRequest extends FormRequest
|
|||
return [
|
||||
'position' => 'required|int|numeric|max:255',
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => [
|
||||
'required',
|
||||
'string',
|
||||
'max:255',
|
||||
"unique:educational_institutions,slug,{$this->educational_institution->id}",
|
||||
],
|
||||
'name' => [
|
||||
'required',
|
||||
'string',
|
||||
|
|
|
@ -16,7 +16,12 @@ class UpdateFacultyRequest extends FormRequest
|
|||
return [
|
||||
'position' => 'required|int|numeric|max:255',
|
||||
'description' => 'string',
|
||||
'slug' => 'required|string|max:255',
|
||||
'slug' => [
|
||||
'required',
|
||||
'string',
|
||||
'max:255',
|
||||
"unique:faculties,slug,{$this->faculty->id}",
|
||||
],
|
||||
'educational_institution_id' => 'required|int|numeric|max:255',
|
||||
'name' => [
|
||||
'required',
|
||||
|
|
Loading…
Reference in New Issue