render hook seemingly called from wrong panel

have this render hook in my AppPanelProvider only, but when I navigate to my admin panel, it gives an error from the livewire component that this hook references.
class AppPanelProvider extends PanelProvider
{
public function boot()
{
FilamentView::registerRenderHook(
'panels::sidebar.nav.end',
fn (): string => Blade::render('@livewire(\'components.location-sidebar\')'),
);
}
...
class AppPanelProvider extends PanelProvider
{
public function boot()
{
FilamentView::registerRenderHook(
'panels::sidebar.nav.end',
fn (): string => Blade::render('@livewire(\'components.location-sidebar\')'),
);
}
...
There's nothing in my AdminPanelProvider referencing that component.
3 Replies
Jon Mason
Jon MasonOP15mo ago
Not sure it matters, but the error is a Route [filament.admin.resources.locations.vendors] not defined, because the vendors page only exists in my app panel. The livewire component called in the render hook is referencing this page.
Jon Mason
Jon MasonOP15mo ago
nvm, my solution was not a solution. It doesn't seem that you can apply scopes to a panel like you can with a page. It seems like it should just work by registering it, so i'm confused.
DrByte
DrByte14mo ago
Does it work if you enumerate the Resources/Pages on which you want it to display? ie: limit it to the pages/resources that your Admin panel detects? eg:
FilamentView::registerRenderHook(
'panels::sidebar.nav.end',
static fn (): View => view('filament.admin.copyright-footer'),
scopes: [
\App\Filament\Admin\Resources\ActivityResource::class,
\App\Filament\Admin\Resources\CategoryResource::class,
\App\Filament\Admin\Resources\ContentResource::class,
\App\Filament\Admin\Resources\UserResource::class,
\App\Filament\Admin\Pages\ManageGeneralSettings::class,
],
);
FilamentView::registerRenderHook(
'panels::sidebar.nav.end',
static fn (): View => view('filament.admin.copyright-footer'),
scopes: [
\App\Filament\Admin\Resources\ActivityResource::class,
\App\Filament\Admin\Resources\CategoryResource::class,
\App\Filament\Admin\Resources\ContentResource::class,
\App\Filament\Admin\Resources\UserResource::class,
\App\Filament\Admin\Pages\ManageGeneralSettings::class,
],
);
Want results from more Discord servers?
Add your server