Skip to content

Commit

Permalink
fixed issue #4
Browse files Browse the repository at this point in the history
  • Loading branch information
lee-to committed Jun 8, 2022
1 parent 3ac2f99 commit 4265c02
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/Resources/MoonShineUserResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ public function fields(): array

Date::make('Дата создания', 'created_at')
->format("d.m.Y")
->default(now())
->sortable()
->hideOnForm()
->showOnExport(),
Expand All @@ -68,8 +69,10 @@ public function rules($item): array
return [
'name' => 'required|min:5',
'moonshine_user_role_id' => 'required',
'email' => 'sometimes|bail|required|email|unique:moonshine_users,email,'.$item->id,
'password' => 'sometimes|nullable|min:6|required_with:password_repeat|same:password_repeat',
'email' => 'sometimes|bail|required|email|unique:moonshine_users,email' . ($item->exists ? ",$item->id" : ''),
'password' => !$item->exists
? 'required|min:6|required_with:password_repeat|same:password_repeat'
: 'sometimes|nullable|min:6|required_with:password_repeat|same:password_repeat',
];
}

Expand Down

0 comments on commit 4265c02

Please sign in to comment.