[Vuejs]-Laravel (ver 6) php artisan route:list return "Target class does not exist" error with production environment (worked fine in local environment)

0👍

I had a similar issue with HomeController, then I checked the routes in the web.php file,
I found it was like the following

Route::get('/', 'HomeController@index');

Then I changed this to the following according to the directory where the Homecontoller resides

Route::get('/', 'App\Http\Controllers\HomeController@index'); 

after that, it worked correctly.

So Please check your controller directory,

if your controller directory is "App\Http\Controllers\Masterdata\CountryController" then add this in the route. it will be like following

Route::get('/', 'App\Http\Controllers\Masterdata\CountryController');

I tried to explain according to my scenario,
Please let me know if this helps and please pardon me if I have got something wrong

Leave a comment