So in my routes.php file I have this:
Route::get('contact', function() {
return view('contact');
});
When I go to domain.com/contact I get a return error. However when I put:
Route::get('/', function() {
return view('contact');
});
and go to domain.com the page appears. Any idea what could be causing this?
Full Routes file:
<?php
/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
Route::get('/', function () {
return view('homeIndex');
});
Route::get('contact', function() {
return view('contact');
});
php artisan route:list returns:
+--------+----------+---------+------+---------+------------+
| Domain | Method | URI | Name | Action | Middleware |
+--------+----------+---------+------+---------+------------+
| | GET|HEAD | / | | Closure | web |
| | GET|HEAD | contact | | Closure | web |
+--------+----------+---------+------+---------+------------+