What seems to be the problem:
I’ve just created a new Laravel 8 / Livewire 2.0 project. (I used Jetstream with Livewire option to create my new project). I created some new Livewire components but my routes web.php file seems to be having issues finding my Livewire components. I’m using the Livewire component as a full controller, instead of Laravel’s controller.
Here is my web.php routes file:
> <?php
> use Illuminate\Support\Facades\Route;
>
> Route::get('/dashboard', App\Http\Livewire\LwDashboard::class)->name('dashboard.index');
My folder structure in App\Http\Livewire path is as follows:
app
-> Http
-> Livewire
-> LwDashboard.php
I’ve followed the documentation from here But sadly it is not working for me.
My composer.json shows latest versions for Laravel and Livewire:
“laravel/framework”: “^8.0”,
“livewire/livewire”: “^2.0”
The error I get when loading the page is:
UnexpectedValueException
Invalid route action: [LwDarkweb].
Controller classLwDarkweb
for one of your routes was not found. Are you sure this controller exists and is imported correctly?
I must have missed something super simple, what do y’all think? Let me know what other info you need, thanks