Summer sale! Save 50% on access to our entire library of courses.Join here →

Enable HTTPS in Laravel Valet

January 28th, 2022

By default, Laravel Valet doesn't use HTTPS. That's great, but if anything you're developing with locally requires HTTPS to be enabled, you're going to need it.

Luckily for us, it's easy to switch back and forth between a secured and non-secured site.

You just need to run this command

valet secure [site]

So for me, the command would be

valet secure codecourse

Now over in the browser, you'll be able to access (in my case) https://codecourse.test

You might need to tweak a few things, particularly if you're serving any assets from the http protocol, but generally everything should just work.

To disable, it's just as easy. Run the unsecure command.

valet unsecure [site]

And that's it! You can now easily switch back and forth between HTTP and HTTPS with Laravel Valet.

Thanks for reading! If you found this article helpful, you might enjoy our practical screencasts too.
Alex Garrett-Smith
Share :


No comments, yet. Be the first to leave a comment.

Table of contents

Tagged under