F
Filament3mo ago
CGM

How to add blade directive to filament head

I'm currently installing https://github.com/silviolleite/laravel-pwa into my filament app, and I'm at the step where I need to include the blade directive @laravelPWA into the <head> of my page. Here is where I need the directive to go:
<html>
<head>
<title>My Title</title>
...
@laravelPWA
</head>
<body>
...
My content
...
</body>
</html>
<html>
<head>
<title>My Title</title>
...
@laravelPWA
</head>
<body>
...
My content
...
</body>
</html>
How do I get to the Filament header template, or how do I add that directive to the header of the filament template?
GitHub
GitHub - silviolleite/laravel-pwa: Looks like an app, feels like an...
Looks like an app, feels like an app, but IS NOT an app. - silviolleite/laravel-pwa
Solution:
You can do this with a renderHook
Jump to solution
2 Replies
Solution
awcodes
awcodes3mo ago
You can do this with a renderHook
CGM
CGMOP3mo ago
Nailed it, thank you @awcodes
->renderHook(
PanelsRenderHook::HEAD_END,
function (): string {
return Blade::render('@laravelPWA');
}
)
->renderHook(
PanelsRenderHook::HEAD_END,
function (): string {
return Blade::render('@laravelPWA');
}
)
Want results from more Discord servers?
Add your server