I have just started using Laravel (v5.7) and I am trying to set it up to work in a virtual host (I'm using the XAMPP package for Windows).
To simplify, the only Route
that works is the get('/', ...)
. Other routes, like get('/other', ...)
fails with Error 404. The other routes are only accessable when running the php artisan serve
server, so I can use port 8000.
However, I wish Apache was handling the requests, without the need of idenifying the port. Is that simple?
A very straight forward code that I'm using and isn't working follows (without controllers):
// ROUTE in routes/web.php
Route::get('/', function() {
return view('home');
});
Route::get('/other', function() {
return view('other');
});
NOTE: I do have both view files home.blade.php
and other.blade.php
in resources/views
directory.