Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

abdulrehman176617's avatar

❓ Issue in Filament Shield with multi-tenancy

❓ Issue After Running php artisan shield:install admin --tenant --generate-relationships

Hi everyone 👋

I’m using Laravel v11, and I ran the following command to set up Filament Shield with multi-tenancy:

php artisan shield:install admin --tenant --generate-relationships

```bash
But after running it, I started getting the following error on every php artisan command:


In Container.php line 961:

  Target class [cache] does not exist.

In Container.php line 959:

  Class "cache" does not exist



 Please Note: I am not using team model — my tenancy is based on a Company model.
0 likes
1 reply
Braunson's avatar

I wonder if Filament Shield is trying to register services before Laravel's core services are fully loaded.

Quick questions:

  1. Are you using a custom cache driver or just the default?
  2. Does this happen with all artisan commands or just specific ones?
  3. Can you check if config/cache.php exists 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?

Please or to participate in this conversation.