FilamentF
Filament2y 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>


in Livewire Component:
    public function render()
    {
        return view('livewire.view')
            ->layout('components.layouts.app');
    }
Was this page helpful?