#27 - separate fields for name and surname

This commit is contained in:
Adrian Hopek
2022-01-24 12:06:36 +01:00
parent e147d24365
commit 816af23ce4
17 changed files with 125 additions and 48 deletions

View File

@@ -28,7 +28,7 @@ class UserObserver
public function updating(User $user): void
{
if ($user->isDirty("name")) {
if ($user->isDirty(["first_name", "last_name"])) {
Storage::delete($user->avatar);
$user->avatar = $this->generator->generateFor($user);
}