Add <script> to each page of a panel?

Hi there, I'm curious, what would be the best way to add external scripts (i.e. analytics, chat widgets) to each page of the panel?
Solution:
I figured it out! Thanks for the suggestion @Tieme. I added this to my panel provider. The view referenced has the <script> tag provided by the service. Here is the code: ```php FilamentView::registerRenderHook( PanelsRenderHook::BODY_START,...
Jump to solution
2 Replies
Solution
Ian_X12
Ian_X124mo ago
I figured it out! Thanks for the suggestion @Tieme. I added this to my panel provider. The view referenced has the <script> tag provided by the service. Here is the code:
FilamentView::registerRenderHook(
PanelsRenderHook::BODY_START,
fn (): View => view('pages._includes.scripts.crisp_chat'),
);
FilamentView::registerRenderHook(
PanelsRenderHook::BODY_START,
fn (): View => view('pages._includes.scripts.crisp_chat'),
);
Want results from more Discord servers?
Add your server
More Posts