Search code examples
laravelhttpslaravel-artisanngrok

Laravel - how to serve laravel project with https on local development


I googled a lot about solution to serve with https. Even I tried ngrok, but it doesn't work properly. Below is the code of ngork.

php artisan serve
cd <path-to-ngrok>
./ngrok http localhost:8000

I am sure Laravel has artisan to serve HTTPS.


Solution

  • it's a standard protocol that HTTPS is listening on port 443, you can simply run the command to listen on that port

    php artisan serve --port=443

    by the way, php artisan serve is for development use only and ssl certificate is for production environment and both of them have no work relation at all as both serve their purpose differently...

    although you can customize your web server to install the SSL certificate and and listening on custom port but you are breaking the standard and the public may doubt and not able to accept it...