Skip to content

Create Route Permissions ​

Generate Spatie Permission records for all actions of a module route.

Command Information ​

  • Signature: modularous:make:route:permissions [--route[=ROUTE]] <route>
  • Aliases: modularous:create:route:permissions
  • Category: Generators

Arguments ​

ArgumentRequiredDescription
routeYesThe module route name to generate permissions for (e.g. products)

Options ​

OptionDefaultDescription
--routenullOptional override for the route name (if different from the argument)

What It Does ​

Resolves the given route name via RouteGenerator and calls createRoutePermissions() to seed Spatie permissions records for every CRUD action defined on that route (index, create, store, show, edit, update, destroy, etc.).

Run this after adding a new module or route to ensure the permission records exist before assigning them to roles.

Examples ​

bash
# Generate permissions for the "products" route
php artisan modularous:make:route:permissions products

# Using the option form
php artisan modularous:make:route:permissions --route=products products