Search code examples
routeslaravel-5.3

Laravel 5.3 web.php not working


I'm web developer. In routes/web.php

Route::group(['middleware' => ['web']], function () {
   Route::get('/', 'HomeController@index');
   Route::get('news/index', 'NewsController@getIndex');
});

If running http://localhost/project/public/news/index it has no action. help me!


Solution

  • Can you clarify? Do the controllers exist? This code works good:

    Route::group(['middleware' => ['web']], function () {
        Route::get('/', function () {
            echo 'one';
        });
        Route::get('news/index', function () {
            echo 'two';
        });
    });
    

    So the problem is with your controllers, or maybe with your apache configuration.