mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-21 13:24:27 +00:00
added seeder
added user to return role
This commit is contained in:
+12
-1
@@ -38,7 +38,7 @@ class User extends Authenticatable implements JWTSubject
|
||||
* @var array
|
||||
*/
|
||||
protected $appends = [
|
||||
'photo_url',
|
||||
'photo_url', 'role'
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -51,6 +51,16 @@ class User extends Authenticatable implements JWTSubject
|
||||
return 'https://www.gravatar.com/avatar/'.md5(strtolower($this->email)).'.jpg?s=200&d=mm';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the role attribute.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRoleAttribute()
|
||||
{
|
||||
return $this->roles->first()->name;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the oauth providers.
|
||||
*
|
||||
@@ -87,4 +97,5 @@ class User extends Authenticatable implements JWTSubject
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user