mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange.git
synced 2026-08-28 08:44:16 +00:00
integrated frontend
This commit is contained in:
+43
-6
@@ -5,6 +5,7 @@ namespace App;
|
||||
use Tymon\JWTAuth\Contracts\JWTSubject;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use App\Notifications\ResetPassword as ResetPasswordNotification;
|
||||
|
||||
class User extends Authenticatable implements JWTSubject
|
||||
{
|
||||
@@ -16,7 +17,7 @@ class User extends Authenticatable implements JWTSubject
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'name', 'email', 'password',
|
||||
'name', 'email', 'password',
|
||||
];
|
||||
|
||||
/**
|
||||
@@ -29,22 +30,58 @@ class User extends Authenticatable implements JWTSubject
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the identifier that will be stored in the subject claim of the JWT.
|
||||
* The accessors to append to the model's array form.
|
||||
*
|
||||
* @return mixed
|
||||
* @var array
|
||||
*/
|
||||
protected $appends = [
|
||||
'photo_url',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the profile photo URL attribute.
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPhotoUrlAttribute()
|
||||
{
|
||||
return 'https://www.gravatar.com/avatar/'.md5(strtolower($this->email)).'.jpg?s=200&d=mm';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the oauth providers.
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function oauthProviders()
|
||||
{
|
||||
return $this->hasMany(OAuthProvider::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send the password reset notification.
|
||||
*
|
||||
* @param string $token
|
||||
* @return void
|
||||
*/
|
||||
public function sendPasswordResetNotification($token)
|
||||
{
|
||||
$this->notify(new ResetPasswordNotification($token));
|
||||
}
|
||||
|
||||
/**
|
||||
* @return int
|
||||
*/
|
||||
public function getJWTIdentifier()
|
||||
{
|
||||
return $this->getKey();
|
||||
}
|
||||
|
||||
/**
|
||||
* Return a key value array, containing any custom claims to be added to the JWT.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getJWTCustomClaims()
|
||||
{
|
||||
return [];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user