Andrius
Andrius
FFilament
Created by Andrius on 1/23/2024 in #❓┊help
Access resource record/model in custom component registered via registerRenderHook
What I am trying to do: I want to use custom livewire component (to use form builder) and register it with hook at position
panels::page.header-widgets.after
panels::page.header-widgets.after
to a certain resource scope. What I did: I've created livewire component, registered it. Everything works fine, component gets rendered in position I've provided.
FilamentView::registerRenderHook(
'panels::page.header-widgets.after',
fn () => Blade::render("@livewire('my-component')"),
scopes: App\Filament\Resources\ArticleResource\Pages\EditArticle::class
);
FilamentView::registerRenderHook(
'panels::page.header-widgets.after',
fn () => Blade::render("@livewire('my-component')"),
scopes: App\Filament\Resources\ArticleResource\Pages\EditArticle::class
);
My issue: Although everything renders fine, I want to use my resource(in which component is rendered) record. I can't find way to get my current
EditArticle
EditArticle
resource page record. Is it possible to get current record of resource (if it is edit page) in custom livewire component ?
4 replies