简体   繁体   中英

How to change the default landing page after serve command

I am wondering if it is possible to change the default startup address after the command

php artisan serve

Because when I run it, I get the default url

Starting Laravel development server: http://127.0.0.1:8000

But my "first page" is when I type

 http://127.0.0.1:8000/index 

in the browser.

So is it possible to automatically give out http://127.0.0.1:8000/index after startup?

If you want to show your index.blade.php at first place then just replace in your routes/web.php

From this

Route::get('/', function () {
   return view('welcome');
});

TO this

Route::get('/', function () {
    return view('index');
});

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM