F
Filament7mo ago
Adel

use filamentphp layout in livewire component

How can I use the same filamentphp layout in standalone livewire component?
view: resources/views/components/layouts/app.blade.php

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>{{ $title ?? 'Page Title' }}</title>

@filamentStyles
</head>
<body>
{{ $slot }}

@filamentScripts
</body>
</html>
view: resources/views/components/layouts/app.blade.php

<!DOCTYPE html>
<html lang="{{ str_replace('_', '-', app()->getLocale()) }}">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>{{ $title ?? 'Page Title' }}</title>

@filamentStyles
</head>
<body>
{{ $slot }}

@filamentScripts
</body>
</html>
in Livewire Component:
public function render()
{
return view('livewire.view')
->layout('components.layouts.app');
}
public function render()
{
return view('livewire.view')
->layout('components.layouts.app');
}
2 Replies
Dan Harrin
Dan Harrin7mo ago
if you want the layout, why not just use a page in a panel? otherwise, you'll just need to copy the html
Soundmit
Soundmit6mo ago
found this post after write mine https://discord.com/channels/883083792112300104/1244624413614276638 same problem, i have a second panel with a filament page and livewire component
Want results from more Discord servers?
Add your server