@@ -18,15 +18,15 @@ class LoginModel extends Model
18
18
protected $ allowedFields = [
19
19
'ip_address ' ,
20
20
'user_agent ' ,
21
- 'email ' ,
21
+ 'identifier ' ,
22
22
'user_id ' ,
23
23
'date ' ,
24
24
'success ' ,
25
25
];
26
26
protected $ useTimestamps = false ;
27
27
protected $ validationRules = [
28
28
'ip_address ' => 'required ' ,
29
- 'email ' => 'required ' ,
29
+ 'identifier ' => 'required ' ,
30
30
'user_agent ' => 'permit_empty|string ' ,
31
31
'user_id ' => 'permit_empty|integer ' ,
32
32
'date ' => 'required|valid_date ' ,
@@ -39,12 +39,12 @@ class LoginModel extends Model
39
39
*
40
40
* @return BaseResult|false|int|object|string
41
41
*/
42
- public function recordLoginAttempt (string $ email , bool $ success , ?string $ ipAddress = null , ?string $ userAgent = null , $ userId = null )
42
+ public function recordLoginAttempt (string $ identifier , bool $ success , ?string $ ipAddress = null , ?string $ userAgent = null , $ userId = null )
43
43
{
44
44
return $ this ->insert ([
45
45
'ip_address ' => $ ipAddress ,
46
46
'user_agent ' => $ userAgent ,
47
- 'email ' => $ email ,
47
+ 'identifier ' => $ identifier ,
48
48
'user_id ' => $ userId ,
49
49
'date ' => date ('Y-m-d H:i:s ' ),
50
50
'success ' => (int ) $ success ,
@@ -60,7 +60,7 @@ public function fake(Generator &$faker): Login
60
60
{
61
61
return new Login ([
62
62
'ip_address ' => $ faker ->ipv4 ,
63
- 'email ' => $ faker ->email ,
63
+ 'identifier ' => $ faker ->email ,
64
64
'user_id ' => null ,
65
65
'date ' => Time::parse ('-1 day ' )->toDateTimeString (),
66
66
'success ' => true ,
0 commit comments