Laravel UnexpectedValueException Invalid route action
php artisan make:controller IndexController
[UnexpectedValueException]
Invalid route action: [App\Http\Controllers\IndexController]
UnexpectedValueException in Route.php line 624:
UnexpectedValueException in Route.php line 624:
Invalid route action: [App\Http\Controllers\IndexController]
in Route.php line 624 at Route->parseAction(array('uses' => 'App\Http\Controllers\IndexController', 'controller' => 'App\Http\Controllers\IndexController')) in Route.php line 107 at Route->__construct(array('GET', 'HEAD'), '/', array('uses' => 'App\Http\Controllers\IndexController', 'controller' => 'App\Http\Controllers\IndexController')) in Router.php line 518 at Router->newRoute(array('GET', 'HEAD'), '/', array('uses' => 'App\Http\Controllers\IndexController', 'controller' => 'App\Http\Controllers\IndexController')) in Router.php line 494 at Router->createRoute(array('GET', 'HEAD'), '/', 'IndexController') in Router.php line 472 at Router->addRoute(array('GET', 'HEAD'), '/', 'IndexController') in Router.php line 132 at Router->get('/', 'IndexController') in Facade.php line 213 at Facade::__callStatic('get', array('/', 'IndexController')) in routes.php line 14 at Route::get('/', 'IndexController') in routes.php line 14 at require('C:\xampp\htdocs\projetos\laravel-curso\app\Http\routes.php') in RouteServiceProvider.php line 41 at RouteServiceProvider->App\Providers\{closure}(object(Router)) at call_user_func(object(Closure), object(Router)) in Router.php line 350 at Router->group(array('namespace' => 'App\Http\Controllers'), object(Closure)) in RouteServiceProvider.php line 42 at RouteServiceProvider->map(object(Router)) at call_user_func_array(array(object(RouteServiceProvider), 'map'), array(object(Router))) in Container.php line 502 at Container->call(array(object(RouteServiceProvider), 'map')) in RouteServiceProvider.php line 68 at RouteServiceProvider->loadRoutes() in RouteServiceProvider.php line 30 at RouteServiceProvider->boot(object(Router)) in RouteServiceProvider.php line 29 at RouteServiceProvider->boot(object(Router)) at call_user_func_array(array(object(RouteServiceProvider), 'boot'), array(object(Router))) in Container.php line 502 at Container->call(array(object(RouteServiceProvider), 'boot')) in Application.php line 734 at Application->bootProvider(object(RouteServiceProvider)) in Application.php line 717 at Application->Illuminate\Foundation\{closure}(object(RouteServiceProvider), '17') at array_walk(array(object(EventServiceProvider), object(RoutingServiceProvider), object(AuthServiceProvider), object(ControllerServiceProvider), object(CookieServiceProvider), object(DatabaseServiceProvider), object(EncryptionServiceProvider), object(FilesystemServiceProvider), object(FormRequestServiceProvider), object(FoundationServiceProvider), object(PaginationServiceProvider), object(SessionServiceProvider), object(ValidationServiceProvider), object(ViewServiceProvider), object(AppServiceProvider), object(AuthServiceProvider), object(EventServiceProvider), object(RouteServiceProvider)), object(Closure)) in Application.php line 718 at Application->boot() in BootProviders.php line 17 at BootProviders->bootstrap(object(Application)) in Application.php line 203 at Application->bootstrapWith(array('Illuminate\Foundation\Bootstrap\DetectEnvironment', 'Illuminate\Foundation\Bootstrap\LoadConfiguration', 'Illuminate\Foundation\Bootstrap\ConfigureLogging', 'Illuminate\Foundation\Bootstrap\HandleExceptions', 'Illuminate\Foundation\Bootstrap\RegisterFacades', 'Illuminate\Foundation\Bootstrap\RegisterProviders', 'Illuminate\Foundation\Bootstrap\BootProviders')) in Kernel.php line 222 at Kernel->bootstrap() in Kernel.php line 117 at Kernel->sendRequestThroughRouter(object(Request)) in Kernel.php line 87 at Kernel->handle(object(Request)) in index.php line 54
Este problema é ocasionado por ser um conflito de rota no Laravel 5.1:
(English: This problem occurs for the confict with the new route in Laravel 5.1)
Route::get('/','IndexController');
Resolução do problem:
(English: Solved problem)
Route::get('/', function () { return view('index'); });