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

  1. In Quick Add, install PHP 8.4 (or 8.3), nginx or Apache, MySQL or MariaDB, and Composer.
  2. 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

  1. Open Sites. Under HTTPS, Lumina creates a certificate authority that exists only on your computer.
  2. Trust it once when asked. Browsers then show a padlock for every .test site and for localhost; Firefox is set up too.
  3. Optionally switch on Force HTTPS to redirect http:// to https://.

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