WEBKERNEL_ACCESS_DENY_ALL=true(or defaultdeny_allin config) but/systemdashboard still loads after login.
config('access-control.deny_all')istruewebkernel_auth('page', Filament\Pages\Dashboard::class)returnsfalsein CLI- Authenticated user still sees the Filament dashboard at
/system
Authorization config looks correct; UI does not match.
Livewire::componentHook() was called in AccessControlServiceProvider::boot().
Livewire wires all component hooks inside LivewireServiceProvider::boot():
// LivewireServiceProvider::boot() — simplified
foreach ($features as $feature) {
app('livewire')->componentHook($feature);
}
ComponentHookRegistry::boot(); // registers mount/hydrate listeners — onceProvider order: all register() methods run first, then all boot() methods. If your hook is only added during your boot() after Livewire already called ComponentHookRegistry::boot(), it sits in the hook list but no mount/hydrate listener is attached.
Filament pages keep their default canAccess(): true. Nothing calls webkernel_auth().
Gate::before(fn () => false) only affects policy / Gate checks (mostly resources). It does not intercept:
Filament\Pages\Page::canAccess()Filament\Widgets\Widget::canView()- Dashboard rendering for the default Filament page
AccessControlServiceProvider now:
- Registers
Livewire::componentHook(FilamentAuthorizationHook::class)inregister() - Adds
EnforceFilamentAuthorizationto every panel viaPanel::configureUsing()inregister() - Keeps
Gate::before+Filament::serving()inboot()as deny-all extras
php -r "
require 'third_party/autoload.php';
\$app = require 'bootstrap/app.php';
\$app->make(Illuminate\Contracts\Console\Kernel::class)->bootstrap();
print_r(Filament\Facades\Filament::getPanel('system')->getAuthMiddleware());
"Expect Webkernel\Component\AccessControl\Filament\Http\Middleware\EnforceFilamentAuthorization in the list.
| Step | Result |
|---|---|
Guest visits /system |
Login page |
| User logs in | 403 |
| Direct URL to dashboard | 403 |
php artisan config:clear
# restart php artisan serve if running| Check | Command / action |
|---|---|
| Config cached with old value | php artisan config:clear |
component-access-control not discovered |
grep access-control bootstrap/cache/packages.php |
| Old PHP process | Restart artisan serve / Octane / FPM workers |
| Custom panel without Filament auth middleware stack | Ensure panel is built through Panel::make() so configureUsing applies |