3
0
Fork 0
This repository has been archived on 2024-11-14. You can view files and clone it, but cannot push or open issues or pull requests.
ThemeParkPlus-Panel/app/User.php
2020-02-26 14:59:58 +01:00

58 lines
1.2 KiB
PHP

<?php
namespace App;
use App\Cache\Cache;
use Illuminate\Contracts\Auth\MustVerifyEmail;
use Illuminate\Foundation\Auth\User as Authenticatable;
use Illuminate\Notifications\Notifiable;
class User extends Authenticatable implements MustVerifyEmail
{
use Notifiable;
protected $guard_name = 'web';
/**
* The attributes that are mass assignable.
*
* @var array
*/
protected $fillable = [
'uuid', 'email', 'password', 'google2fa_secret',
];
/**
* The attributes that should be hidden for arrays.
*
* @var array
*/
protected $hidden = [
'password', 'remember_token', 'google2fa_secret',
];
/**
* The attributes that should be cast to native types.
*
* @var array
*/
protected $casts = [
'email_verified_at' => 'datetime',
];
private $username;
public function username() {
if(!empty($this->username))
return $this->username;
$username = Cache::getUsername($this->uuid);
$this->username = $username;
return $username;
}
public function photo() {
return 'https://crafatar.com/avatars/'.$this->uuid.'?overlay';
}
}