Skip to content

Instantly share code, notes, and snippets.

@NazmusShakib
Last active April 17, 2018 04:27
Show Gist options
  • Save NazmusShakib/3a8d94a7021eadcab67065ca2b1e1e91 to your computer and use it in GitHub Desktop.
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.
<?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