Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

zaster's avatar

Livewire - View [layouts.app] not found.

I am getting this error

View [layouts.app] not found. 
(View: ....vendor\livewire\livewire\src\Macros\livewire-view-component.blade.php)

i tried

composer dump-autoload

and

php artisan view:clear

nothing worked

route

use App\Http\Livewire\Test;
..

Route::get('/test', Test::class);

class

<?php

namespace App\Http\Livewire;

use Livewire\Component;

class Test extends Component
{
    public function render()
    {
        return view('livewire.test');
    }
}

view livewire\test.blade.php

<div>
    test
</div>
0 likes
10 replies
apex1's avatar

Did you include the livewire styles and script tags?

1 like
zaster's avatar

@apex1

It should just display

test

in the browser right

I can't understand why it says layouts.app not found

isimmons's avatar

Awesome @snapey thanks for that. Today is literally day one for me and I'm learning from Caleb Porzio 2 year old screencasts but trying to upgrade as we go to L9 and Livewire 2

Here's some code for a "register" route if it helps anyone.

routes/web.php

use App\Http\Livewire\Register;

Route::get('/register', Register::class);

App/Http/Livewire/Register.php chaining methods to change the layout file and slot name

public function render()
    {
        return view('livewire.register')
            ->layout('components.layouts.app')
            ->slot('content');
    }

Livewire/register.blade.php

<div>
    Hello Foo! Welcome to the register page!
</div>

components/layouts/app so I can use it with other non-livewire views as an x-component as usual.

<x-layouts.header />

<body>
    {{ $content }}
</body>

<x-layouts.footer />
kepsondiaz's avatar

in your Livewire.php config file you remove 'layout' => 'components.layouts.app' and add only 'layout' => 'layouts.app' . That solved my problem .

1 like

Please or to participate in this conversation.