diff --git a/src/Models/Permission.php b/src/Models/Permission.php index 37f72c3aa..5f3e060f8 100644 --- a/src/Models/Permission.php +++ b/src/Models/Permission.php @@ -184,6 +184,7 @@ protected function fillModelFromArray(array $attributes) $this->exists = true; $this->original['id'] = $attributes['id']; } + return $this; } @@ -197,6 +198,7 @@ protected function fillModelFromArray(array $attributes) public static function getModelFromArray(array $attributes): ?PermissionContract { $permission = new static; + return $permission->fillModelFromArray($attributes); } } diff --git a/src/Models/Role.php b/src/Models/Role.php index a9bbe2d43..6810b5ae5 100644 --- a/src/Models/Role.php +++ b/src/Models/Role.php @@ -170,6 +170,7 @@ protected function fillModelFromArray(array $attributes) $this->exists = true; $this->original['id'] = $attributes['id']; } + return $this; } @@ -183,6 +184,7 @@ protected function fillModelFromArray(array $attributes) public static function getModelFromArray(array $attributes): ?RoleContract { $roles = new static; + return $roles->fillModelFromArray($attributes); } } diff --git a/src/PermissionRegistrar.php b/src/PermissionRegistrar.php index 70d344353..527f017c9 100644 --- a/src/PermissionRegistrar.php +++ b/src/PermissionRegistrar.php @@ -127,6 +127,7 @@ private function loadPermissions() unset($permissions[$i]['roles'][$j]['pivot']); } } + return $permissions; }); if (is_array($this->permissions)) { @@ -159,6 +160,7 @@ public function getPermissions(array $params = [], bool $onlyOne = false): Colle return false; } } + return true; });