|
@@ -15,11 +15,17 @@ public function __construct(
|
|
|
|
|
|
|
|
public function allGuestPermissions(): ?Collection
|
|
public function allGuestPermissions(): ?Collection
|
|
|
{
|
|
{
|
|
|
- return $this->model->where(column: 'user_type', operator: 'guest')->join(table: 'permissions', first: 'user_type_permissions.permission_id', operator: '=', second: 'permissions.id')->get();
|
|
|
|
|
|
|
+ return $this->model->where('user_type', UserTypeSource::Guest)
|
|
|
|
|
+ ->join('permissions', 'user_type_permissions.permission_id', '=', 'permissions.id')
|
|
|
|
|
+ ->select('permissions.*', 'user_type_permissions.bits', 'user_type_permissions.*')
|
|
|
|
|
+ ->get();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
public function allPermissionsByUserType(UserTypeSource $userType): ?Collection
|
|
public function allPermissionsByUserType(UserTypeSource $userType): ?Collection
|
|
|
{
|
|
{
|
|
|
- return $this->model->where(column: 'user_type', operator: $userType)->join(table: 'permissions', first: 'user_type_permissions.permission_id', operator: '=', second: 'permissions.id')->get();
|
|
|
|
|
|
|
+ return $this->model->where('user_type', $userType)
|
|
|
|
|
+ ->join('permissions', 'user_type_permissions.permission_id', '=', 'permissions.id')
|
|
|
|
|
+ ->select('permissions.*', 'user_type_permissions.bits', 'user_type_permissions.*')
|
|
|
|
|
+ ->get();
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|