Laravel

Resolved: forced HTTPS redirect in Homestead running Laravel app

Now a days most browsers enforce HTTPS, and this is bit of trouble in local development environment and some get annoyed due to this behavior.

And when working with Laravel & Homestead, this issue might occur.

Solutions to this  issue can very depending on your OS, I am on Ubuntu 18 Desktop.

Possible solutions for Ubuntu:

  • Self signed certificates, Take a look at GitGist.
  • I personally went for following solution:
    Use .test/.app as domain TLD

    • Update your Homestead.yaml, by changing
      sites:
      – map: domain.test
      – to: /var/www/domain.test/public- map: domain.app
      – to: /var/www/domain.app/public
    • Under Homestead directory run
      • vagrant provision
      • Or vagrant destroy && vagrant up

But if you are interested in registering self certificate in Mac, follow this well written post, read now…

On Mac the best alternative to Homestead would be  Laravel Valet.
Out of the box, Valet support includes, but is not limited to:

Author: Danyal
I'm a skilled programmer specializing in Vue.js/Nuxt.js for front-end development and PHP Laravel for back-end solutions. I have a strong focus on API design and development, complemented by experience in web server setup and maintenance. My versatile expertise ensures seamless creation and maintenance of web applications, covering everything from intuitive user interfaces to robust server-side functionality. Passionate about coding and driven by a lifelong learning mindset, I invite you to explore more at danyal.dk.