laravel/sentinel
Laravel Sentinel adds simple, lightweight tools for monitoring and reporting within Laravel apps. Built as a package you can drop in to capture key events, surface issues, and gain basic operational visibility without heavy setup or external services.
can()).Sentinel::authenticate()) may clash with modern dependency injection patterns, requiring refactoring for testability or microservices.sentinel_users, sentinel_roles) that conflict with Laravel’s default users table, necessitating schema migrations or separate databases.composer require, publish migrations). Supports multi-guard setups (e.g., web and api guards) via config/auth.php.Hash::make() → Hash::driver()->make()). Laravel 8+ introduces breaking changes (e.g., first-party auth scaffolding).RouteServiceProvider, Facade-based auth).Hash Facade, RouteServiceProvider).sentinel_users) require scripts to migrate to Laravel’s default users table or modern RBAC packages (e.g., Spatie).hasAccess()) may trigger eager-loading issues without optimization (e.g., withRoles()->withPermissions()).sentinel:clear-cache) adds operational complexity.Hash::driver()->make()).AuthServiceProvider guard binding).users table migrations).Sentinel::authenticate(), hasAccess()).users table, Facade-heavy code).composer require laravel/sentinel
php artisan vendor:publish --provider="Sentinel\SentinelServiceProvider" --tag="migrations,config"
users table is disabled or renamed):
php artisan migrate
Hash Facade) in SentinelServiceProvider:
$this->app->bind('hash', function () {
return Hash::getDriver();
});
// Example: Migrate Sentinel roles to Spatie
$spatieRole = \Spatie\Permission\Models\Role::create(['name' => 'admin']);
$user->assignRole($spatieRole);
Auth::user()->can('edit-post')).| Component | Compatibility | Workarounds |
|---|---|---|
| Laravel ≤5.4 | ✅ Native support | None |
| Laravel 6–7 | ⚠️ Partial (deprecated features) | Override Hash, adjust middleware |
| Laravel 8+ | ❌ Conflicts with Breeze/Jetstream/Sanctum | Avoid; use Spatie Laravel-Permission instead |
| PHP 8.3+ | ❌ Untested | Use PHP 8.2 or patch manually |
| Docker/Localhost | ⚠️ Storage volume issues | Mount storage in Dockerfile |
| Multi-Guard | ✅ Supported (config/auth.php) | Ensure guard names match (e.g., sentinel) |
| Multi-Tenancy | ⚠️ Possible but unsupported | Custom Sentinel extension (e.g., tenant-aware user provider) |
| API Authentication | ❌ Session-based only | Use Sanctum/Passport alongside (not recommended) |
| Testing | ⚠️ Facade-heavy (hard to mock) | Use Sentinel::login($user) in tests |
role:admin).How can I help you explore Laravel packages today?