I installed Laravel latest version i.e v7 but when I try to change the route or create my own route that route is not working.
Here is the default route.
Route::get('/', function () {
return view('welcome');
});
This is what I'm trying to hit URL in the browser: http://localhost/mobileshop/public/
This is working fine but when I try to change it or write my own route it shows error 404 | not found
This is what I'm trying when I get this error
Route::get('/login', function () {
return view('welcome');
});
Or
Route::get('/login', function () {
dd("my own route");
});
Both are not working what to do?
This is what I'm trying to hit URL in the browser: http://localhost/mobileshop/public/login
I researched and found something here: https://laracasts.com/discuss/channels/laravel/order-of-routes-in-webphp?page=1
but whatever they tell I don't think I'm doing that mistake, am I?
I'm using XAMPP.
I myself changed route, views, and many other things but still, I'm there at error 404.
When I stop XAMPP and run php artisan serve and use: http://127.0.0.1:8000/login URL in browser its working fine. So is there any issue in my XAMPP? If there is an issue in my XAMPP then why default route is working I'm not understanding.
Can anyone help me to issue and about how to use XAMPP rather than php artisan serve?
Thanks in advance.