Initial Commit
The initial public commit of MVGL website code.
This commit is contained in:
commit
b39ecf1638
2043 changed files with 215154 additions and 0 deletions
131
app/Models/User.php
Normal file
131
app/Models/User.php
Normal file
|
@ -0,0 +1,131 @@
|
|||
<?php
|
||||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Core\Traits\SpatieLogsActivity;
|
||||
use Illuminate\Contracts\Auth\MustVerifyEmail;
|
||||
use Illuminate\Database\Eloquent\Factories\HasFactory;
|
||||
use Illuminate\Foundation\Auth\User as Authenticatable;
|
||||
use Illuminate\Notifications\Notifiable;
|
||||
|
||||
class User extends Authenticatable implements MustVerifyEmail
|
||||
{
|
||||
use HasFactory;
|
||||
use Notifiable;
|
||||
use SpatieLogsActivity;
|
||||
|
||||
/**
|
||||
* The attributes that are mass assignable.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $fillable = [
|
||||
'username',
|
||||
'password',
|
||||
'email',
|
||||
'role_id',
|
||||
'avatar',
|
||||
'coverpic',
|
||||
'bio',
|
||||
'status',
|
||||
'api_token',
|
||||
'stripe_id',
|
||||
'profile_views',
|
||||
'list_views',
|
||||
'blog_views',
|
||||
'banned',
|
||||
'user_deleted',
|
||||
'ip_address'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be hidden for arrays.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $hidden = [
|
||||
'password',
|
||||
'api_token',
|
||||
'stripe_id',
|
||||
'remember_token'
|
||||
];
|
||||
|
||||
/**
|
||||
* The attributes that should be cast to native types.
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
protected $casts = [
|
||||
'email_verified_at' => 'datetime',
|
||||
];
|
||||
|
||||
public function getRememberToken()
|
||||
{
|
||||
return $this->remember_token;
|
||||
}
|
||||
|
||||
public function setRememberToken($value)
|
||||
{
|
||||
$this->remember_token = $value;
|
||||
}
|
||||
|
||||
/**
|
||||
* User relation to user gamertags model
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function gamertags()
|
||||
{
|
||||
return $this->hasOne(UserGamerTag::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* User relation to user info model
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function info()
|
||||
{
|
||||
return $this->hasOne(UserInfo::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* User relation to user notification settings model
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function notifications()
|
||||
{
|
||||
return $this->hasOne(UserNotificationSetting::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* User relation to role model
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasOne
|
||||
*/
|
||||
public function role()
|
||||
{
|
||||
return $this->hasOne(Role::class, 'id', 'role_id');
|
||||
}
|
||||
|
||||
/**
|
||||
* User relation to game list model
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function gameList()
|
||||
{
|
||||
return $this->hasMany(GameList::class);
|
||||
}
|
||||
|
||||
/**
|
||||
* User relation to user site settings model
|
||||
*
|
||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany
|
||||
*/
|
||||
public function siteSettings()
|
||||
{
|
||||
return $this->hasMany(UserSiteSetting::class);
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue