Skip to content

Commit

Permalink
user update requrest validation
Browse files Browse the repository at this point in the history
  • Loading branch information
bobimicroweber committed Mar 14, 2022
1 parent e0b92a4 commit 80e3908
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
Expand Up @@ -14,8 +14,11 @@ class UserCreateRequest extends FormRequest
public function rules()
{
$rules = [
'username' => 'required|unique:users,username',
'email' => 'unique:users,email',
'first_name'=>'max:500',
'last_name'=>'max:500',
'phone'=>'max:500',
'username' => 'required|unique:users,username|max:500',
'email' => 'unique:users,email|max:500',
];

return $rules;
Expand Down
Expand Up @@ -19,13 +19,17 @@ public function rules()
$ignore = Rule::unique('users')->ignore($this->id ?? 0, 'id');

return [
'first_name'=>'max:500',
'last_name'=>'max:500',
'phone'=>'max:500',
'email' => [
$ignore,
'max:500'
],
'username' => [
$ignore,
'max:500'
],

];

}
Expand Down

0 comments on commit 80e3908

Please sign in to comment.