0

I'm new learning Laravel. I following a tutorial on Laravel 5.2 where using PostsController. I followed the method, I comment out all code in routes/web.php and put on Route::get('/post','PostsController@index'); line. then I edited the PostsController file and put this "its working" inside the index function. public function index() { return "its working"; } Not showing the line in screen. but showing errors.

C:\xampp\htdocs\blog
Illuminate\Contracts\Container\BindingResolutionException Target class [PostsController] does not exist. http://127.0.0.1:8000/post

What should I do now ? Any solution and any other way ?

Here's the error screenshot

  • things have changed since Laravel 5.2; I would most likely not follow something for this version if you are using a newer version, such as 8 – lagbox Feb 06 '21 at 19:54

1 Answers1

0

first check your php version

php artisan -v

check your laravel version if your version is not same then go to laravel official doc and write web file accordingly to your laravel version. also check your controller name is it same in web and controllers