Add Auth System (Breeze)
This commit is contained in:
@@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
//use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Relations\HasMany;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
@@ -63,6 +64,23 @@ class User extends Authenticatable
|
||||
'discord_avatar' => 'string',
|
||||
];
|
||||
|
||||
/**
|
||||
* Get the user name
|
||||
*/
|
||||
public function getUserName(): string
|
||||
{
|
||||
if (!$this->discord_name) {
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
if ($this->discord_name == $this->name)
|
||||
{
|
||||
return $this->name;
|
||||
}
|
||||
|
||||
return "{$this->name} ({$this->discord_name})";
|
||||
}
|
||||
|
||||
/**
|
||||
* Has Many Playlists.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user