I'm trying to follow the Larva tutorial and make a controller. This is what I have so far, it works for the person in the video, but mine says the controller cannot be found. I don't know what to do to fix it. Thanks!
web.php file:
Route::get('/', [PagesController::class, 'home']);
PagesController.php file:
<?php namespace App\Http\Controllers; use Illuminate\Http\Request; use App\Http\Controllers\PagesController; class PagesController extends Controller { public function home() { return view('welcome', [ 'foo' => 'bar' ]); } }
PagesController.php file
error message
Web.php file
I think this is happening due to the route cache you added earlier
Clear all cached commands
Then check if this get('/') route is bound to the home() method on the controller
I hope it solves your problem..