Fresh laravel lumen 5.8
installed but controller name cannot be found in route
I created UserController
in App\Http\Controllers\User
User Controller Content:
namespace App\Http\Controllers;
class UserController extends Controller {
public function index() {
return 'User list';
}
}
Loaded in route:
$router->get('/user', 'User\UserController@index')
Error:
Class App\Http\Controllers\User\UserController does not exist
I also tried with absolute namespace App\Http\Controllers\User\UserController@index
but it still doesn't work.
It works if I don't put UserController
in User folder
namespace App\Http\Controllers\User;
– linuxartisan