public static function getAnAdmin()
    {
        $permission = new Permission();
        $getPermission = $permission->where('app', 'global')->where('key', 'admin')->where('value', true)->get()->first();

        if($getPermission) {
            $adminRelations  = RoleRelation::where('groupID', $getPermission->groupID)->first();
            if($adminRelations) {
                return User::find($adminRelations->userID);
            }
        }

        throw new \Exception("No admin user found.");
    }
public static function getAnAdmin()
    {
        $permission = new Permission();
        $getPermission = $permission->where('app', 'global')->where('key', 'admin')->where('value', true)->get()->first();

        if($getPermission) {
            $adminRelations  = RoleRelation::where('groupID', $getPermission->groupID)->first();
            if($adminRelations) {
                return User::find($adminRelations->userID);
            }
        }

        throw new \Exception("No admin user found.");
    }
public static function getAnAdmin ( ) { $ permission = new Permission ( ) ; $ getPermission = $ permission -> where ( 'app' , 'global' ) -> where ( 'key' , 'admin' ) -> where ( 'value' , true ) -> get ( ) -> first ( ) ; if ( $ getPermission ) { $ adminRelations = RoleRelation :: where ( 'groupID' , $ getPermission -> groupID ) -> first ( ) ; if ( $ adminRelations ) { return User :: find ( $ adminRelations -> userID ) ; } } throw new \ Exception ( "No admin user found." ) ; }
Get an admin.

@return object
@throws \Exception
Get an admin .