when front-end parse a token to back-end, how to use JwtAuth to check the user relationship(role) that is a admin (role=1) or normal (role=0) ?
any idea?
The relationship with user and role
User
public function role()
{
return $this->hasOne('FACI\Entity\User\Role','user_id','id');
}
Role
protected $fillable = ['user_id','role'];
public function user()
{
return $this->belongsTo('FACI\Entity\User','user_id','id');
}
from Newest questions tagged laravel-5 - Stack Overflow http://ift.tt/2oPuQvu
via IFTTT
Aucun commentaire:
Enregistrer un commentaire