Files
Global-Jain/app/Models/Traits/User/Methods/UserMethods.php

46 lines
702 B
PHP
Raw Normal View History

2025-11-05 10:37:10 +05:30
<?php
namespace App\Models\Traits\User\Methods;
trait UserMethods
{
/**
* @return mixed
*/
public function isSuperAdmin()
{
return $this->hasRole(config('access.users.super_admin_role'));
}
/**
* @return mixed
*/
public function isAdmin()
{
return $this->hasRole(config('access.users.admin_role'));
}
/**
* @return bool
*/
public function isActive()
{
return $this->status;
}
/**
* @return string
*/
public function getRoleName()
{
$role = $this->roles->first();
if ($role) {
return $role->name;
}
return '';
}
}