-
On laravel-permission/src/PermissionRegistrar.php Lines 22 to 26 in a769221 laravel-permission/src/PermissionRegistrar.php Lines 66 to 67 in a769221 But on getPermissionClass(), getRoleClass() we get an instance of the contract instead of a string from getterlaravel-permission/src/PermissionRegistrar.php Lines 220 to 226 in a769221 So, for the method names to be more consistent, it should be something like this public function getPermissionClass(): string
{
return $this->permissionClass;
}
public function getPermissionInstance(): Permission
{
return app(Permission::class);
}
public function getRoleClass(): string
{
return $this->roleClass;
}
public function getRoleInstance(): Role
{
return app(Role::class);
} Also on laravel-permission/src/PermissionRegistrar.php Lines 153 to 161 in a769221 Ping @drbyte, @freekmurze |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments
-
Even worse on, laravel-permission/src/Traits/HasPermissions.php Lines 20 to 23 in a769221 laravel-permission/src/Traits/HasPermissions.php Lines 42 to 49 in a769221 laravel-permission/src/PermissionRegistrar.php Lines 221 to 223 in a769221 |
Beta Was this translation helpful? Give feedback.
-
As discussed in #2368, thanks for your work on optimizing this. In addition to being more intuitive to both read/understand and use, it will improve performance as well. |
Beta Was this translation helpful? Give feedback.
As discussed in #2368, thanks for your work on optimizing this. In addition to being more intuitive to both read/understand and use, it will improve performance as well.