I'm just learning laravel and been following Laravel 5.4 from scratch while setting up my own project. Everything was fine until I added another route.
This is what my routes/web.php looks like now:
Route::get('/', function () {
return view('welcome');
});
Route::get('logs', 'LogsController@index') ;
Route::get('logs/{log}', 'LogsController@show');
Route::get('logs/create', 'LogsController@create');
The first 3 routes work, I added them earlier. When I go to the last route using http://project.test/logs/create I just get a Page Not Found. No syntax error or anything... just a 404.
I ran php artisan route:list which returned this:
+--------+----------+-------------+------+--------------------------------------------+--------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+-------------+------+--------------------------------------------+--------------+
| | GET|HEAD | / | | Closure | web |
| | GET|HEAD | api/user | | Closure | api,auth:api |
| | GET|HEAD | logs | | App\Http\Controllers\LogsController@index | web |
| | GET|HEAD | logs/create | | App\Http\Controllers\LogsController@create | web |
| | GET|HEAD | logs/{log} | | App\Http\Controllers\LogsController@show | web |
+--------+----------+-------------+------+--------------------------------------------+--------------+
That looks right.
I ran php artisan config:cache, php artisan route:clear and php artisan cache:clear and cleared browser cache. Still no change.
What am I missing here? It's not telling me it can't find the function in the controller, even when I give it a function that doesn't exists. Giving it the function of index doesn't work either.