pagination testing

This commit is contained in:
2019-10-28 23:54:33 -05:00
parent 9619fde4ed
commit cfaebed0fe
3 changed files with 32 additions and 5 deletions

View File

@@ -34,10 +34,6 @@ class User extends Authenticatable
protected $table = 'users';
public function getUserType() {
return User::where('user_type')->get();
}
public function role() {
return $this->hasOne('\App\Models\User\UserRole', 'character_id', 'character_id');
}
@@ -111,4 +107,30 @@ class User extends Authenticatable
public function getId() {
return $this->character_id;
}
public function getUserType() {
return User::where('user_type')->get();
}
public function getRole() {
$role = UserRole::where(['character_id' => $this->character_id])->first();
return $role->role;
}
public function getPermissionsArray() {
$perms = UserPermission::where([
'character_id' => $this->character_id,
])->get('permission')->toArray();
return $perms;
}
public function getPermissions() {
$perms = UserPermission::where([
'character_id' => $this->character_id,
])->get('permission');
return $perms;
}
}