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');
}
via Chebli Mohamed
Aucun commentaire:
Enregistrer un commentaire