Solved myself
Dec 22, 2023
3
Level 1
Why Livewire returned me Undefined variable?
Hello every body! Tell me please, why Livewire component returned me undefined variable? This is my component code:
<?php
namespace App\Livewire;
use Livewire\Component;
class CreatePost extends Component
{
public $title = 'Post title...';
public function render(): \Illuminate\Contracts\View\View|\Illuminate\Foundation\Application|\Illuminate\Contracts\View\Factory|\Illuminate\Contracts\Foundation\Application
{
return view('livewire.create-post');
}
}
P.S: code from livewire.laravel.com - https://livewire.laravel.com/docs/components#setting-properties
And my blade code:
<div>
{{ $test }}
</div>
I don't understand, why... What I do wrong? Thanks in advance!
Level 1
Please or to participate in this conversation.