F
Filament3mo ago
daniik

Register page outside the panels

Hi, I have a problem with register my custom page outside the panels and always got this error:
Unable to find component: [app.filament.livewire.pages.registration-request-page]
Unable to find component: [app.filament.livewire.pages.registration-request-page]
If I insert page into ->pages() property in one of my panels it work just fine, but then I've got this:
Method App\Filament\Livewire\Pages\RegistrationRequestPage::registerNavigationItems does not exist.
Method App\Filament\Livewire\Pages\RegistrationRequestPage::registerNavigationItems does not exist.
From this I deduce that I'm registering the page wrong, but I don't know where I should have added it when it's outside the panels. The page is similar to the registration page only it is for a different model so I used a custom page.
11 Replies
LeandroFerreira
LeandroFerreira3mo ago
Would you like to customize the default page or create another simple page?
daniik
daniik3mo ago
I made my own SimplePage.
class RegistrationRequestPage extends SimplePage implements HasForms
class RegistrationRequestPage extends SimplePage implements HasForms
It is customized copy of Login or Register.
LeandroFerreira
LeandroFerreira3mo ago
could you share the whole code?
daniik
daniik3mo ago
I was thinking about something like..login and registration page has be somewhere registered as well. Cause they works, but can't find where or if they really are.
LeandroFerreira
LeandroFerreira3mo ago
Did you create this view filament.pages.registration-request and create a route to access this component?
daniik
daniik3mo ago
Yes I have this in my web.php
Route::get('registration-request', RegistrationRequestPage::class)->name('registration-request');
Route::get('registration-request', RegistrationRequestPage::class)->name('registration-request');
It's even weirder than it seems, I completely forgot to write that it loads the page, loads the form and everything is fine, I get the error only when I try to submit the form or after some time..that means that it's not looking for the component as the view but the component as the class. And as I said earlier when I register RegistrationRequestPage::class into AdminPanelProvider .. ->pages() it works, but panel load failed after login
LeandroFerreira
LeandroFerreira3mo ago
This page should work in your custom route outside the panel. If you want to create a page inside the panel use this https://filamentphp.com/docs/3.x/panels/resources/custom-pages/
daniik
daniik3mo ago
I'm trying to keep this page outside the panel, it was just debugging ideas.
Vp
Vp3mo ago
Can you try like this (https://github.com/filamentphp/filament/issues/8702#issuecomment-1800882585) instead of web.php It's a little old thread and maybe different use-case, but if it helps..
daniik
daniik3mo ago
Thanks, but it is a bit different use-case. I'm just doing a registration page for different model then User..maybe I will just override handleRegistration() and Register.php
Want results from more Discord servers?
Add your server