FilamentF
Filament3y ago
Fonz

404 on admin/new (Filament\Pages\Tenancy\RegisterTenant)

Hi, I am using multi-tenancy and have created a tenant registration page as described in the docs.

CreatePlateform.php

<?php
namespace App\Filament\Pages;
 ...
use Filament\Pages\Tenancy\RegisterTenant;
use Illuminate\Database\Eloquent\Model;
use App\Models\Tenant;

class CreatePlateform extends RegisterTenant
{
    public static function getLabel(): string
    {
        return 'Create new plateform';
    }
    
    public function form(Form $form): Form
    {
        return $form
            ->schema([
                TextInput::make('name')
                ...
            ]);
    }
}


AdminPanelProvider.php

...
use App\Filament\Pages\CreatePlateform;
...
->tenantRegistration(CreatePlateform::class)
...


route:list

    GET|HEAD admin/new .......... filament.admin.tenant.registration › App\Filament\Pages\CreatePlateform


If I click on "Create new plateform" in the menu, I get a "404 | Not found" error.


Could it be a permission problem? I am using althinect/filament-spatie-roles-permissions. But wouldn't this throw a 403 error? I have a "Super Admin" role, but they are attachted to the exiting tenants (one role per tenant).

Thank you
Solution
Adding a canView() function to the page fixes the issue
Was this page helpful?