- Can I use Laravel Sentinel with Laravel 13 for a new project?
- No, avoid Sentinel for new projects. It’s unmaintained, conflicts with Laravel’s first-party auth (Breeze/Jetstream), and lacks support for modern features like API tokens. Use Spatie’s Laravel-Permission or Laravel Breeze instead.
- How do I install Sentinel without breaking Laravel’s default auth?
- Disable Laravel’s default auth in `config/auth.php` and run `php artisan sentinel:install`. This prevents duplicate users tables and guard conflicts, but ensure you’re on Laravel 8–13. For Laravel 10+, expect manual overrides for breaking changes.
- Does Sentinel support multi-tenancy or dynamic permissions?
- Yes, Sentinel is extensible—you can customize user models, guards, and event listeners. However, dynamic permissions require manual cache management (`php artisan sentinel:clear-cache`) after role changes to avoid stale data.
- Will Sentinel work with Laravel Passport or Sanctum for APIs?
- No, Sentinel conflicts with these packages due to overlapping auth logic and database tables. If you need API auth, use Laravel Breeze with Sanctum or Passport directly, or migrate to Spatie’s permission system.
- How do I migrate from Sentinel to Spatie Laravel-Permission?
- Export Sentinel roles/permissions via `DB::table('sentinel_roles')->get()`, then import them into Spatie’s tables. Document the process early—this is non-trivial due to schema differences. Test thoroughly in staging before switching.
- Are there security risks using Sentinel in production?
- Yes, Sentinel’s last update was 2017, so unpatched vulnerabilities likely exist. Assume risks for sensitive data (PII, financial). Conduct manual security audits, disable unused features, and monitor for CVEs. Consider it a stopgap, not long-term.
- Can I use Sentinel’s heartbeat endpoint for uptime monitoring?
- Yes, Sentinel provides a `/health` endpoint for basic diagnostics (status, version, DB checks). It’s lightweight but lacks advanced monitoring like Laravel Forge or Healthchecks. For production, pair it with external tools like Pingdom.
- How do I test Sentinel’s RBAC in PHPUnit?
- Mock the `Sentinel` facade and verify role/permission checks with assertions like `assertTrue(Sentinel::check('admin'))`. Test edge cases: role inheritance, permission revocation, and bulk operations. Use `Sentinel::getUser()` to simulate authenticated requests.
- What’s the best alternative to Sentinel for Laravel 10+?
- For new projects, use **Laravel Breeze** (auth scaffolding) + **Spatie Laravel-Permission** (RBAC). For APIs, combine Breeze with **Sanctum** or **Passport**. These packages are actively maintained, Laravel-first, and avoid Sentinel’s monolithic design.
- How do I handle database conflicts between Sentinel and Laravel’s default users table?
- Disable Laravel’s default migrations (`php artisan migrate --ignore-table=users`) and configure Sentinel to use `sentinel_*` tables exclusively. For isolation, place Sentinel tables in a separate database or schema. Always back up before running migrations.