Components

Full Page Components

// routes/web.php
use App\Livewire\CreatePost;

Route::get('/create-post', CreatePost::class);

Pass data to layout (local)

return view($this->view)
    ->layout('components.layouts.app', [
        'pageTitle' => $this->pageTitle,
    ]);

Pass data to layout (package)

return view($this->view, $this->prepareData())
    ->layout(\Naykel\Gotime\View\Layouts\AppLayout::class, [
        'pageTitle' => $this->pageTitle,
    ]);
#[Layout('layouts.app')]
public function render() {
    return view('livewire.create-post');
}

Package layout

If your layout has an associated class file, you will need to reference that for any custom logic or properties.

public function render() {
    return view('livewire.edit-create-user')
        ->layout(\Naykel\Gotime\View\Layouts\AppLayout::class, [
            'title' => $this->title
        ]);
}