- How do I install dejwcake/admin-auth in a Laravel app?
- Install it with Composer using composer require dejwcake/admin-auth, then let Laravel package discovery register the service provider on Laravel 11 and newer. On older Laravel versions you may need to add the provider manually. The supplied excerpt does not show publish tags or environment variables, so confirm installation and config steps in the README before rollout.
- Which Laravel and PHP versions does dejwcake/admin-auth support?
- The provided material does not include composer.json version constraints or a full Testbench matrix, so exact PHP and Laravel support is not confirmed. The technical assessment says the dev setup implies a modern, currently supported Laravel matrix, but that is provisional. Check the package composer.json and CI matrix before adopting it.
- Does dejwcake/admin-auth provide login, roles, permissions, guards, and middleware?
- Yes. The package overview describes authentication and authorization scaffolding for Laravel admin panels, including login handling, role and permission checks, middleware, guards, and configurable views for securing admin routes.
- How do I protect admin routes with dejwcake/admin-auth middleware and guards?
- Register the package guard and apply its auth and authorization middleware to your admin route group, then verify the middleware order so authentication runs before permission checks. The exact guard name, middleware aliases, and route examples are not shown in the supplied excerpt, so copy them from the README. Test guest, authenticated, and unauthorized requests against the protected routes.
- Can I customize the admin login views in dejwcake/admin-auth?
- The overview says the package includes configurable views for the admin authentication interface. The supplied excerpt does not show the publish command or view paths, so check the README for vendor:publish tags. After publishing, keep custom login views under version control and retest after package updates.
- What changed in dejwcake/admin-auth version 2.0.4?
- The 2.0.4 release notes focus on the ApplyUserLocale middleware, which previously ignored non-string user language values and now handles them instead of skipping setLocale. This is a silent behavior change for applications already on 2.x because affected users may start receiving their stored locale instead of the default. Verify enum handling and add a regression test before upgrading.
- Does the dejwcake/admin-auth locale middleware work with enum-cast language attributes?
- The release notes indicate non-string language attributes are no longer silently skipped, which most likely covers backed enum casts. The assessment warns that it is unspecified whether a string-backed enum is unwrapped to its value or whether an int-backed enum could reach setLocale and cause a type error. Test your exact cast type and locale values in a staging branch.
- Is dejwcake/admin-auth safe for production admin panels?
- The package is described as scaffolding for admin authentication, so production safety depends on correct guard configuration, route protection, password policy, rate limiting, and any additional controls you require. The technical assessment is provisional because it is based only on release notes, not source review. Review the code, pin a tested version, and monitor updates before using it for sensitive admin panels.
- How should I test dejwcake/admin-auth in my Laravel application?
- Write feature tests for login success and failure, role and permission enforcement, middleware ordering, and guest redirects on your admin routes. If you use the locale middleware, add coverage for null, string, and enum-cast language attributes. The assessment mentions an Orchestra Testbench-based suite and CI coverage, so mirror those checks for your Laravel version.
- What are alternatives to dejwcake/admin-auth for Laravel admin authentication?
- Common alternatives include Laravel Breeze or Jetstream for starter authentication, Filament or Backpack for full admin panels, and spatie/laravel-permission for role and permission handling. Compare their Laravel version support, maintenance activity, and authorization features against dejwcake/admin-auth. This package is narrow admin auth scaffolding, so choose based on whether you need a full panel or only guards and middleware.