Last active
April 17, 2018 04:27
-
-
Save NazmusShakib/3a8d94a7021eadcab67065ca2b1e1e91 to your computer and use it in GitHub Desktop.
Most of all the same only sum up getJWTIdentifier getJWTCustomClaims method with there entrust dependency.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace App; | |
use Tymon\JWTAuth\Contracts\JWTSubject; | |
use Illuminate\Notifications\Notifiable; | |
use Illuminate\Foundation\Auth\User as Authenticatable; | |
class User extends Authenticatable implements JWTSubject | |
{ | |
use Notifiable; | |
/** | |
* The attributes that are mass assignable. | |
* | |
* @var array | |
*/ | |
protected $fillable = [ | |
'name', 'email' | |
]; | |
/** | |
* The attributes that should be hidden for arrays. | |
* | |
* @var array | |
*/ | |
protected $hidden = [ | |
'password', 'remember_token', | |
]; | |
public function getJWTIdentifier() | |
{ | |
return $this->getKey(); | |
} | |
public function getJWTCustomClaims() | |
{ | |
return []; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment