Replies: 1 comment
-
|
I think you can use scopes and access FilamentView::registerRenderHook(
PanelsRenderHook::PAGE_START,
fn (): View => view('my-custom-banner'),
scopes: [
ViewUser::class,
EditUser::class,
]
);<div>
{{ $this->getRecord() }}
</div> |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Package
Panel builder
Package Version
4.2.0
How can we help you?
Hi everyone 👋
I’m exploring Render Hooks in Filament 4 and was wondering —
is there any way to access the current record instance when using a render hook inside a Resource page (for example,
EditRecordorViewRecord)?Something like this:
So far, I haven’t found a clean way to get the current record (like $this->record inside the Livewire component) from within the hook callback.
Has anyone found a workaround or a best practice for this?
Or maybe there’s an intended way to get the Livewire component context for the current page?
Thanks in advance 🙏
Beta Was this translation helpful? Give feedback.
All reactions