- What is nuewire/acl used for in Laravel?
- nuewire/acl is an optional role and permission management package for Laravel applications that use nuewire/users. It adds ACL-style role and permission handling powered by spatie/laravel-permission. Use it when you need to assign roles, define permissions, and authorize actions across your app.
- How do I install nuewire/acl with Composer?
- Install the package through Composer and make sure its nuewire/users and spatie/laravel-permission dependencies are available in your application. After installation, follow the package README for any required service provider registration, configuration publishing, and migrations. Run your database migrations before assigning roles or permissions.
- Does nuewire/acl require nuewire/users?
- Yes. nuewire/acl is described as optional role and permission management for nuewire/users, so it is intended to extend that user package rather than replace it. If you are not using nuewire/users, you may want to use spatie/laravel-permission directly instead.
- How does nuewire/acl relate to spatie/laravel-permission?
- nuewire/acl is powered by spatie/laravel-permission, so the underlying role and permission storage and behavior come from that package. nuewire/acl provides the integration layer for nuewire/users and a framework-friendly ACL API. You generally should not need to duplicate role and permission logic outside the package.
- How do I assign roles and permissions to a user?
- Create the roles and permissions your application needs, then assign them to users through the package API or the underlying spatie/laravel-permission methods. The exact helper names and workflow are documented in the package README. After assignment, verify authorization using the package's permission checks.
- Can I create custom permissions and ACL rules?
- Yes. The package is designed for defining ACL rules and managing permissions, so you can model permissions around the actions and resources in your application. You can then assign those permissions to roles or users and check them during authorization. Keep permission names consistent so controllers, policies, and views can reuse them.
- How do I check permissions in controllers and Blade views?
- Use the authorization API provided by nuewire/acl, which builds on the role and permission handling from spatie/laravel-permission. You can perform permission checks in controllers, middleware, policies, or Blade conditionals before showing restricted actions. Check the package README for the exact helper or method names supported by your version.
- Which Laravel versions does nuewire/acl support?
- The supported Laravel versions are not specified in the provided package summary, so check the repository composer.json and README for the current constraints. Confirm compatibility with your Laravel version, PHP version, nuewire/users, and spatie/laravel-permission before installing in an existing project.
- Is nuewire/acl suitable for production and how should I test it?
- It can be used in production when its dependencies and supported Laravel versions match your application, but you should review the repository for maintenance activity and release history. Write feature tests that seed roles and permissions, assign them to users, and assert that allowed and denied actions behave correctly. Also test edge cases such as users with no roles and permission changes after login.
- What are alternatives to nuewire/acl for Laravel ACL?
- The most direct alternative is spatie/laravel-permission itself, which provides the underlying role and permission system. You can also use Laravel Gates and Policies for application-specific authorization, or packages such as Bouncer for other ACL approaches. Choose nuewire/acl when you want its nuewire/users integration and ACL workflow rather than wiring those pieces manually.