This commit is contained in:
2023-12-14 19:03:25 +05:00
parent a3771218f0
commit 445884782a
12 changed files with 404 additions and 30 deletions

View File

@@ -16,7 +16,6 @@ use Spatie\Permission\Traits\HasRoles;
class User extends Authenticatable
{
use Actionable;
use HasApiTokens;
use HasFactory;
use HasRoles;
@@ -75,6 +74,14 @@ class User extends Authenticatable
return $this->hasMany(LoanOrder::class);
}
/**
* Check if user has role.
*/
public function withoutRole(): bool
{
return $this->roles->count() === 0;
}
/**
* Check if user is me.
*/
@@ -138,4 +145,12 @@ class User extends Authenticatable
{
return ! is_null($this->phone_verified_at);
}
/**
* Profile page of user
*/
public function profilePage(): string
{
return '/resources/users/'. $this->id;
}
}