Level 18
I wonder if Filament Shield is trying to register services before Laravel's core services are fully loaded.
Quick questions:
- Are you using a custom cache driver or just the default?
- Does this happen with all artisan commands or just specific ones?
- Can you check if
config/cache.phpexists and is properly configured?
Immediate fixes to try:
Option 1: Clear and rebuild
php artisan config:clear
php artisan cache:clear
php artisan config:cache
composer dump-autoload
Option 2: Check service provider order
In bootstrap/app.php, ensure core providers load before Shield:
return Application::configure(basePath: dirname(__DIR__))
->withProviders([
// Core Laravel providers load first
BeyondCode\LaravelWebSockets\WebSocketsServiceProvider::class,
// Then third-party
Spatie\Permission\PermissionServiceProvider::class,
// [IMPORTANT] Shield should be last!!
])
Option 3: Manual Shield setup (if above fails)
# Remove Shield temporarily
composer remove bezhansalleh/filament-shield
# Reinstall without auto-discovery
composer require bezhansalleh/filament-shield --no-scripts
php artisan shield:install admin --tenant # Skip --generate-relationships for now
The --generate-relationships flag is likely the culprit. Does removing it and running the command again resolve the container issue?