From 8e8e6cafecdf99bd10935cd85441119599e54f6c Mon Sep 17 00:00:00 2001 From: Daniel Supernault Date: Wed, 25 Nov 2020 10:10:16 -0700 Subject: [PATCH] Update AuthLogin listener --- app/Listeners/AuthLogin.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/app/Listeners/AuthLogin.php b/app/Listeners/AuthLogin.php index 9d1ce4a9c..45bf9c81a 100644 --- a/app/Listeners/AuthLogin.php +++ b/app/Listeners/AuthLogin.php @@ -42,6 +42,13 @@ class AuthLogin protected function userProfile($user) { if (empty($user->profile)) { + if($user->created_at->lt(now()->subDays(1))) { + $p = Profile::withTrashed()->whereUserId($user->id)->first(); + if($p) { + $p->restore(); + return; + } + } DB::transaction(function() use($user) { $profile = Profile::firstOrCreate(['user_id' => $user->id]); if($profile->wasRecentlyCreated == true) {