= il y a 2 mois
Parent
commit
4719e793f3
1 fichiers modifiés avec 3 ajouts et 2 suppressions
  1. 3 2
      app/Models/User.php

+ 3 - 2
app/Models/User.php

@@ -66,7 +66,7 @@ class User extends BaseModel
     {
         if ($this->full_name) return $this->full_name;
         if($this->name_first || $this->name_last){
-           return $this->name_first . ' ' . $this->name_last; 
+           return $this->name_first . ' ' . $this->name_last;
         }
         return $this->getEmail();
     }
@@ -116,7 +116,8 @@ class User extends BaseModel
     }
 
     public function latestLogInPin(){
-        $loginOrSignupAttempt = LoginOrSignupAttempt::where('email', 'ilike', $this->email)->where('is_valid', true)->orderBy('created_at', 'desc')->first();
+        $loginOrSignupAttempt = LoginOrSignupAttempt::whereRaw('email ilike ' . $this->email)
+            ->where('is_valid', true)->orderBy('created_at', 'desc')->first();
         if($loginOrSignupAttempt){
             return $loginOrSignupAttempt->pin;
         }