Hook: roles.register_permissions

Last updated on May 20, 2026 19:06

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