Run Laravel locally with HTTPS
Secure cookies, OAuth callbacks and service workers want https://. Lumina gives every Laravel project a trusted https://name.test address with no certificate commands.
1. Install the stack
- In Quick Add, install PHP 8.4 (or 8.3), nginx or Apache, MySQL or MariaDB, and Composer.
- Press Start All on the Dashboard.
2. Create or add the project
Create a new one with QuickApp › Laravel: Lumina runs Composer, creates the database and writes .env. Or put an existing project in the www folder: a folder named shop answers at http://shop.test, served from its public folder.
3. Turn on HTTPS
- Open Sites. Under HTTPS, Lumina creates a certificate authority that exists only on your computer.
- Trust it once when asked. Browsers then show a padlock for every
.testsite and forlocalhost; Firefox is set up too. - Optionally switch on Force HTTPS to redirect
http://tohttps://.
4. Point Laravel at the new address
In .env:
APP_URL=https://shop.test
DB_HOST=127.0.0.1
DB_PORT=3306
DB_USERNAME=root
DB_PASSWORD=
Questions
Do I need mkcert or OpenSSL?
No. Lumina makes and renews the certificates itself.
Does it work with Vite in Laravel?
Yes. Run npm run dev as usual; the page itself is served at https://shop.test.
Where do test emails go?
To Mailpit, if you install it: see catch Laravel mail with Mailpit.
Related guides
-
Catch Laravel mail locally with Mailpit
Send every email from your local Laravel or PHP app to a local Mailpit inbox instead of real people, with the .env settings to use.
-
Trusted HTTPS for localhost
Get https://localhost and https://project.test with a padlock and no browser warning, using a certificate authority that exists only on your computer.