F
Filament16mo ago
Travis

ComponentNotFoundException on Tenant Registration

I am getting an error when I register a new tenant. I'm not sure how the multiple panels should work together, but I have a widget on my default panel that provides a link to another panel's tenant route. This lands the user on the panel's tenant registration page when they have no tenants. The form can be filled out, but when submitting, an error occurs. It's a Livewire ComponentNotFoundException...where it can't find app.filament.pages.tenancy.register-organization. (My panel's tenant registration form class is App\Filament\Pages\Tenancy\RegisterOrganization::class.) It appears that this happens before the handleRegistration() method is called. Any input, advice, answers...or whatever...? 🤔 Thanks in advance. 🤓
13 Replies
lucasvieira96
lucasvieira9616mo ago
I have the same problem 😦
Travis
TravisOP16mo ago
Well, I'm not happy for you, @lucasvieira96 , but I am happy that I'm no longer alone. 😅 @lucasvieira96 Any luck on this one...? I am sort of stuck and not sure how to get more eyeballs on this problem. It seems like more than two people would be trying this and suffering from the same problem. 🤔
lucasvieira96
lucasvieira9616mo ago
I ended up not messing with it anymore, because the error occurred in a sandbox project that I made to test v3, I went back to the development of another project that is still in v2 😦 but investigating I ended up seeing that there were more people with this problem and there was an open issue for this, but I ended up not following how it is at the moment I believe that for the moment it is waiting 😕 I'm thinking of starting new projects in v3 only in september or october because of the bugs and mainly because Livewire is still in beta version
Travis
TravisOP16mo ago
Thx for your response. I will take a look at the issues on github and try to find and follow it. 🤓
mstfkhazaal
mstfkhazaal16mo ago
move your page to App/Filament/YourPanelName/Page/tenancy/
Saifallak
Saifallak16mo ago
can you post RegisterOrganization class? also your panel from panel provider ? @travis.elkins @lucasvieira96 because it works very well with me
Travis
TravisOP16mo ago
Sorry...not sure what you mean by this. Move which page...? The RegisterOrganization page...? Also, can you be clearer with the path and maybe say why it needs to be moved there...? Is it Page or Pages? Is it tenancy or Tenancy? If the panel provider class is WidgetsPanelProvider, then should the path be App/Filament/WidgetsPanelProvider/Page/tenancy or App/Filament/Widgets/Page/tenancy...? Here's my RegisterOrganization class:
namespace App\Filament\Pages\Tenancy;

use App\Models\Organization;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Pages\Tenancy\RegisterTenant;

class RegisterOrganization extends RegisterTenant
{
public static function getLabel(): string
{
return 'Register Organization';
}

public function form(Form $form): Form
{
return $form
->schema([
$this->nameField(),
$this->descriptionField(),


// $table->string('website')
// ->default('');
// $table->string('logo_url')
// ->nullable();
// $table->date('founded')
// ->nullable();
// $table->string('size')
// ->default(StaffSize::UNDISCLOSED->value);
]);
}

private function nameField()
{
return Forms\Components\TextInput::make('name');
}

private function descriptionField()
{
return Forms\Components\MarkdownEditor::make('description');
}

protected function handleRegistration(array $data): Organization
{
$organization = Organization::create($data);

$organization->members()->attach(auth()->user());

return $organization;
}
}
namespace App\Filament\Pages\Tenancy;

use App\Models\Organization;
use Filament\Forms;
use Filament\Forms\Form;
use Filament\Pages\Tenancy\RegisterTenant;

class RegisterOrganization extends RegisterTenant
{
public static function getLabel(): string
{
return 'Register Organization';
}

public function form(Form $form): Form
{
return $form
->schema([
$this->nameField(),
$this->descriptionField(),


// $table->string('website')
// ->default('');
// $table->string('logo_url')
// ->nullable();
// $table->date('founded')
// ->nullable();
// $table->string('size')
// ->default(StaffSize::UNDISCLOSED->value);
]);
}

private function nameField()
{
return Forms\Components\TextInput::make('name');
}

private function descriptionField()
{
return Forms\Components\MarkdownEditor::make('description');
}

protected function handleRegistration(array $data): Organization
{
$organization = Organization::create($data);

$organization->members()->attach(auth()->user());

return $organization;
}
}
And here's the EmployersPanelProvider...just the top part as the rest is default/auto-generated:
namespace App\Providers\Filament;

use App\Filament\Pages\Tenancy\RegisterOrganization;
use App\Models\Organization;
use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;

class EmployersPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('employers')
->path('employers')
->tenant(Organization::class)
->tenantRegistration(RegisterOrganization::class)
namespace App\Providers\Filament;

use App\Filament\Pages\Tenancy\RegisterOrganization;
use App\Models\Organization;
use Filament\Http\Middleware\Authenticate;
use Filament\Http\Middleware\DisableBladeIconComponents;
use Filament\Http\Middleware\DispatchServingFilamentEvent;
use Filament\Pages;
use Filament\Panel;
use Filament\PanelProvider;
use Filament\Support\Colors\Color;
use Filament\Widgets;
use Illuminate\Cookie\Middleware\AddQueuedCookiesToResponse;
use Illuminate\Cookie\Middleware\EncryptCookies;
use Illuminate\Foundation\Http\Middleware\VerifyCsrfToken;
use Illuminate\Routing\Middleware\SubstituteBindings;
use Illuminate\Session\Middleware\AuthenticateSession;
use Illuminate\Session\Middleware\StartSession;
use Illuminate\View\Middleware\ShareErrorsFromSession;

class EmployersPanelProvider extends PanelProvider
{
public function panel(Panel $panel): Panel
{
return $panel
->id('employers')
->path('employers')
->tenant(Organization::class)
->tenantRegistration(RegisterOrganization::class)
Can you share any of your code...? And/or point to anything online that helps (besides the docs)...? I feel like I've been through the docs several times and have not missed anything....but who knows...? 😅
lucasvieira96
lucasvieira9616mo ago
I solved this problem here I had created my tenancy registration and edit pages in the following sequence: App\Filament\Pages\Tenancy\CLASS_NAME_HERE, but if you notice the Provider of the Panel has a configuration that applies to the mapping of pages:
lucasvieira96
lucasvieira9616mo ago
After I restructured the folders it worked now my tenancy page files were in the same structure as the discoveryPages directive
lucasvieira96
lucasvieira9616mo ago
Travis
TravisOP16mo ago
Thx. I have been relying on the docs...and while I may have missed something, I never even took the time to look at the rest of the panel configuration. 🫢 I'll take a close look now and make the necessary adjustments. Thx again for replying and sharing your findings. 🤓
lucasvieira96
lucasvieira9616mo ago
🚀
BKF Dev
BKF Dev16mo ago
When you create the custom register page via console, make sure to select the right panel, it should work 🙂
Want results from more Discord servers?
Add your server