Answers for "laravel 9 target class controller does not exist"

PHP
11

Target class [Controller] does not exist.

//accessing any function in the controller (this is web.php file)
use App\Http\Controllers\PostsController;

Route::get('/post', 'App\Http\Controllers\PostsController@index');
Posted by: Guest on October-27-2020
7

laravel target class does not exist

Uncomment this line in app>>provider>>RouteServiceProvider.php file
// protected $namespace = 'App\\Http\\Controllers';
Posted by: Guest on January-08-2021
0

controller class does not exist laravel

The $namespace property:

Though there is a mention of a $namespace property to be set on your RouteServiceProvider in the Release notes and commented in your RouteServiceProvider this does not have any effect on your routes. It is currently only for adding a namespace prefix for generating URLs to actions. So you can set this variable, but it by itself won't add these namespace prefixes, you would still have to make sure you would be using this variable when adding the namespace to the route groups.
Posted by: Guest on May-28-2021

Code answers related to "laravel 9 target class controller does not exist"

Browse Popular Code Answers by Language