Hello I made a new project to test this because i'm having problems trying to render the blade/livewire components with the $slot on the app.blade.php
I have this app.blade.php in /resources/views/components/layouts
<!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>
@vite(['resources/css/app.css', 'resources/js/app.js'])
</head>
<body>
{{ $slot }}
</body>
</html>
Made a simple Counter livewire component as the documentation says to see why it's not working on other projects where i'm having the same problem.
Livewire Counter component
<x-layouts.app>
<div>
<h1>{{ $count }}</h1>
<button wire:click="increment">+</button>
<button wire:click="decrement">-</button>
</div>
</x-layouts.app>
Counter blade file
<?php
namespace App\Livewire;
use Livewire\Component;
class Counter extends Component
{
public $count = 1;
public function increment()
{
$this->count++;
}
public function decrement()
{
$this->count--;
}
public function render()
{
return view('livewire.counter');
}
}
In my livewire config file I have the 'layout' => 'components.layouts.app'
I don't know why but still getting the error of Undefined variable $slot I dont know anything else to try or what could be causing the error...