I am having trouble to run my code on Laravel 8 routing with laravel-livewire.
The class is within Livewire\LandingPage
.
The error I'm getting is
Attribute [livewire] does not exist
Here are my routes
<?php
use Illuminate\Support\Facades\Route;
Route::livewire('/' , 'LandingPage');
Route::middleware(['auth:sanctum', 'verified'])->get('/dashboard', function () {
return view('dashboard');
})->name('dashboard');
If you are using a recent install of Laravel 8, you will have Livewire V2. In this version, Route::livewire()
has been removed. Instead, you specify a normal get()
route, with the action being the Livewire component class.
Route::get('/' , App\Http\Livewire\LandingPage::class);
If you use livewire v1.x please use this annotation :
//(livewire v1.x)
Route::livewire('/post', 'LandingPage');
If you are using livewire v2.0 please use this one :
//(livewire v2.x)
Route::get('/post', \App\Http\Livewire\LandingPage::class);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With