© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
4 replies
Disouric

Issue with Tenancy-enabled test

I am in the process of developing a test that uses a resource situated within a panel, which has tenancy functionality enabled. However, I'm encountering challenges in getting the test to function as expected.

Below is the PHP code snippet representing the test:
it('can see own chargers', function () {
    $user = User::factory()->create();
    $this->actingAs($user);

    $team = Team::factory()->create();
    $team->users()->attach($user);

    $chargers = Charger::factory()->count(10)->create();

    livewire(ChargerResource\Pages\ListChargers::class, [
        'tenant' => $team,
    ])->assertCanSeeTableRecords($chargers);
});
it('can see own chargers', function () {
    $user = User::factory()->create();
    $this->actingAs($user);

    $team = Team::factory()->create();
    $team->users()->attach($user);

    $chargers = Charger::factory()->count(10)->create();

    livewire(ChargerResource\Pages\ListChargers::class, [
        'tenant' => $team,
    ])->assertCanSeeTableRecords($chargers);
});


Upon execution, I'm confronted with the following error message:
FAILED  Tests\Feature\Filament\App\ChargerResourceTest > it can see own chargers                                                             ViewException   
Missing required parameter for [Route: filament.app.resources.chargers.view] [URI: app/{tenant}/chargers/{record}/overview] [Missing parameter: tenant].
FAILED  Tests\Feature\Filament\App\ChargerResourceTest > it can see own chargers                                                             ViewException   
Missing required parameter for [Route: filament.app.resources.chargers.view] [URI: app/{tenant}/chargers/{record}/overview] [Missing parameter: tenant].

Any assistance in resolving this issue would be greatly appreciated.
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Test tenancy redirects
FilamentFFilament / ❓┊help
13mo ago
How to test with multi-tenancy ?
FilamentFFilament / ❓┊help
3y ago
multi-tenancy Issue with SuperAdminSeeder
FilamentFFilament / ❓┊help
3y ago
Multi Tenancy Subdomain Issue
FilamentFFilament / ❓┊help
5mo ago