- Form Request array syntax: Convert pipe (|) delimited validation rules from strings into an array of validation rules while using Laravel Rule objects where available
- Streamline order methods: Streamline query builder orderBy calls with asc and desc arguments. - delete some old Request-Clases
This commit is contained in:
parent
6156bdf0c6
commit
50ceeb193b
18 changed files with 143 additions and 128 deletions
|
@ -24,17 +24,45 @@ class CreatePersonRequest extends Request
|
|||
public function rules()
|
||||
{
|
||||
return [
|
||||
'academic_title' => 'nullable|min:2|max:255',
|
||||
'last_name' => 'required|min:3|max:255|unique_with:persons,first_name,date_of_birth',
|
||||
'first_name' => 'required|min:3|max:255',
|
||||
'email' => 'required|email|max:50|unique:persons,email',
|
||||
'academic_title' => [
|
||||
'nullable',
|
||||
'min:2',
|
||||
'max:255',
|
||||
],
|
||||
'last_name' => [
|
||||
'required',
|
||||
'min:3',
|
||||
'max:255',
|
||||
'unique_with:persons,first_name,date_of_birth',
|
||||
],
|
||||
'first_name' => [
|
||||
'required',
|
||||
'min:3',
|
||||
'max:255',
|
||||
],
|
||||
'email' => [
|
||||
'required',
|
||||
'email',
|
||||
'max:50',
|
||||
'unique:persons,email',
|
||||
],
|
||||
// 'email' => [
|
||||
// 'required', 'email', 'max:100',
|
||||
// Rule::unique('persons')->ignore($user->id),
|
||||
// ],
|
||||
'identifier_orcid' => 'nullable|min:19|max:50',
|
||||
'status' => 'required|boolean',
|
||||
'date_of_birth' => 'nullable|date'
|
||||
'identifier_orcid' => [
|
||||
'nullable',
|
||||
'min:19',
|
||||
'max:50',
|
||||
],
|
||||
'status' => [
|
||||
'required',
|
||||
'boolean',
|
||||
],
|
||||
'date_of_birth' => [
|
||||
'nullable',
|
||||
'date',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
|
@ -26,17 +26,45 @@ class EditPersonRequest extends Request
|
|||
public function rules()
|
||||
{
|
||||
return [
|
||||
'academic_title' => 'nullable|min:2|max:255',
|
||||
'last_name' => 'required|min:3|max:255|unique_with:persons,first_name,date_of_birth',
|
||||
'first_name' => 'required|min:3|max:255',
|
||||
'email' => 'required|email|max:50|unique:persons,email',
|
||||
'academic_title' => [
|
||||
'nullable',
|
||||
'min:2',
|
||||
'max:255',
|
||||
],
|
||||
'last_name' => [
|
||||
'required',
|
||||
'min:3',
|
||||
'max:255',
|
||||
'unique_with:persons,first_name,date_of_birth',
|
||||
],
|
||||
'first_name' => [
|
||||
'required',
|
||||
'min:3',
|
||||
'max:255',
|
||||
],
|
||||
'email' => [
|
||||
'required',
|
||||
'email',
|
||||
'max:50',
|
||||
'unique:persons,email',
|
||||
],
|
||||
// 'email' => [
|
||||
// 'required', 'email', 'max:100',
|
||||
// Rule::unique('persons')->ignore($user->id),
|
||||
// ],
|
||||
'identifier_orcid' => 'nullable|min:19|max:50',
|
||||
'status' => 'required|boolean',
|
||||
'date_of_birth' => 'nullable|date'
|
||||
'identifier_orcid' => [
|
||||
'nullable',
|
||||
'min:19',
|
||||
'max:50',
|
||||
],
|
||||
'status' => [
|
||||
'required',
|
||||
'boolean',
|
||||
],
|
||||
'date_of_birth' => [
|
||||
'nullable',
|
||||
'date',
|
||||
],
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
editor.link_modal.header
Reference in a new issue