Hook: roles.register_permissions
Last updated on May 21, 2026 05:10
Overview
Type: Action
Location: app/Providers/AppServiceProvider.php
Register custom permissions into the role/permission system. Modules use this to define their own permissions that appear in the admin role editor.
Parameters
| Param | Type | Description |
|---|---|---|
$permissionRegistry |
PermissionRegistry | Permission registry instance |
Usage Example
Hook::addAction('roles.register_permissions', function ($registry) {
$registry->register('view analytics', 'Analytics', 'View analytics dashboard');
$registry->register('export reports', 'Analytics', 'Export reports to CSV');
});
Related Hooks
- auth.login.pre_token - Intercept login for 2FA