Changeset View
Changeset View
Standalone View
Standalone View
src/app/User.php
Show First 20 Lines • Show All 447 Lines • ▼ Show 20 Lines | class User extends Authenticatable implements JWTSubject | ||||
* @return \Illuminate\Database\Eloquent\Relations\HasMany | * @return \Illuminate\Database\Eloquent\Relations\HasMany | ||||
*/ | */ | ||||
public function settings() | public function settings() | ||||
{ | { | ||||
return $this->hasMany('App\UserSetting', 'user_id'); | return $this->hasMany('App\UserSetting', 'user_id'); | ||||
} | } | ||||
/** | /** | ||||
* Suspend this domain. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function suspend(): void | |||||
{ | |||||
if ($this->isSuspended()) { | |||||
return; | |||||
} | |||||
$this->status |= User::STATUS_SUSPENDED; | |||||
$this->save(); | |||||
} | |||||
/** | |||||
* Unsuspend this domain. | |||||
* | |||||
* @return void | |||||
*/ | |||||
public function unsuspend(): void | |||||
{ | |||||
if (!$this->isSuspended()) { | |||||
return; | |||||
} | |||||
$this->status ^= User::STATUS_SUSPENDED; | |||||
$this->save(); | |||||
} | |||||
/** | |||||
* Return users controlled by the current user. | * Return users controlled by the current user. | ||||
* | * | ||||
* Users assigned to wallets the current user controls or owns. | * Users assigned to wallets the current user controls or owns. | ||||
* | * | ||||
* @return \Illuminate\Database\Eloquent\Builder Query builder | * @return \Illuminate\Database\Eloquent\Builder Query builder | ||||
*/ | */ | ||||
public function users() | public function users() | ||||
{ | { | ||||
▲ Show 20 Lines • Show All 112 Lines • Show Last 20 Lines |