© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•15mo ago
Shaung Bhone

Filament Multi-Tenancy

I'm out of ideas for testing with Filament Tenancy, which sometimes gives me a 403 error for the Filament resource. Some resources are working.

    ->beforeEach(function () {
        $this->setupAdmin();

        $this->tenant = Tenant::factory()->create();

        $this->admin->tenants()->attach($this->tenant);

        actingAs($this->admin);

        Filament::setTenant($this->tenant);
    ->beforeEach(function () {
        $this->setupAdmin();

        $this->tenant = Tenant::factory()->create();

        $this->admin->tenants()->attach($this->tenant);

        actingAs($this->admin);

        Filament::setTenant($this->tenant);

    public function setupAdmin()
    {
        $this->seed();

        $this->admin = User::where('email', 'admin@admin.com')->first();

        $role = Role::firstOrCreate(['name' => 'admin']);
        $permission = Permission::all();

        $this->admin->assignRole($role);

        $this->admin->givePermissionTo($permission);
    }
    public function setupAdmin()
    {
        $this->seed();

        $this->admin = User::where('email', 'admin@admin.com')->first();

        $role = Role::firstOrCreate(['name' => 'admin']);
        $permission = Permission::all();

        $this->admin->assignRole($role);

        $this->admin->givePermissionTo($permission);
    }

<?php

use App\Filament\Resources\TechnicianResource;

use function Pest\Laravel\get;

it('can render page', function () {
    get(TechnicianResource::getUrl('index'))
        ->assertSuccessful();
})
    ->group('technician');
<?php

use App\Filament\Resources\TechnicianResource;

use function Pest\Laravel\get;

it('can render page', function () {
    get(TechnicianResource::getUrl('index'))
        ->assertSuccessful();
})
    ->group('technician');

class TechnicianResource extends Resource
{
    protected static ?string $model = Technician::class;

    protected static ?string $tenantOwnershipRelationshipName = 'tenant';
class TechnicianResource extends Resource
{
    protected static ?string $model = Technician::class;

    protected static ?string $tenantOwnershipRelationshipName = 'tenant';
Screenshot_2567-12-06_at_01.07.13.png
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

Multi tenancy with filament
FilamentFFilament / ❓┊help
2y ago
Multi-tenancy and Filament Imports
FilamentFFilament / ❓┊help
2y ago
Filament v3, Multi-tenancy login
FilamentFFilament / ❓┊help
2y ago
multi tenancy with Filament V3 & stancl/tenancy package?
FilamentFFilament / ❓┊help
3y ago