Skip to content

Commit 44d580f

Browse files
committed
Implement the Auth Interface on User instead of extending.
1 parent 98b3bc6 commit 44d580f

1 file changed

Lines changed: 22 additions & 2 deletions

File tree

app/models/User.php

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
<?php
22

3-
use Illuminate\Auth\EloquentUser;
3+
use Illuminate\Auth\UserInterface;
44

5-
class User extends EloquentUser {
5+
class User implements UserInterface {
66

77
/**
88
* The database table used by the model.
@@ -18,4 +18,24 @@ class User extends EloquentUser {
1818
*/
1919
protected $hidden = array('password');
2020

21+
/**
22+
* Get the unique identifier for the user.
23+
*
24+
* @return mixed
25+
*/
26+
public function getAuthIdentifier()
27+
{
28+
return $this->getKey();
29+
}
30+
31+
/**
32+
* Get the password for the user.
33+
*
34+
* @return string
35+
*/
36+
public function getAuthPassword()
37+
{
38+
return $this->password;
39+
}
40+
2141
}

0 commit comments

Comments
 (0)