If you have PHP installed locally and you would like to use PHP's built-in development server to serve your application, you may use the serve
Artisan command. This command will start a development server at http://localhost:8000
:
php artisan serve
Of course, more robust local development options are available via Homestead and Valet.
Also it's possible to use a custom port, something like 8080
. You can do this with the --port
option.
php artisan serve --port=8080
If you have a local domain in your hosts file, you can set the hostname. This can be done by the --host
option.
php artisan serve --host=example.dev
You can also run on a custom host and port, this can be done by the following command.
php artisan serve --host=example.dev --port=8080