How I configured (Laravel) Valet + PHP to send ALL email to Mailhog on Mac w/ Homebrew

I needed to configure PHP + Valet to send any and all emails to Mailhog. This is how I configured my system:

Basically:

brew install mailhog
brew services start mailhog

Then in /opt/homebrew/etc/php/<version>/conf.d/z-php.ini Add:

sendmail_path=/opt/homebrew/bin/mailhog sendmail

Then:

brew services restart php
valet restart

…and if you are using valet isolate in a specific site, also:

valet isolate php@<version>

This should tell that version of PHP to send ANY email via /opt/homebrew/bin/mailhog sendmail which should end up in the Mailhog UI at http://127.0.0.1:8025.

You can also:

valet proxy mailhog.test http://127.0.0.1:8025

And use mailhog.test to access Mailhog.

Code

How I configured NIGINX + Valet to stop the 504 Gateway Time out during long XDebug Sessions

In this video I explain how to stop NGINX (installed via Valet) from 504 Gateway Time-out during long XDebug sessions.

By default this is set to 30 seconds, so if I was debugging something for longer than 30 seconds it would timeout and I would have to restart my xDebug session — annoying!

After doing some research, I finally figured out how to include an NGINX configuration file with these configurations:

proxyconnecttimeout 1200;

proxyreadtimeout 1200;
proxysendtimeout 1200;

fastcgireadtimeout 1200;
fastcgisendtimeout 1200;

Note, you can add these directly to /opt/homebrew/etc/nginx/nginx.conf before any Valet configs are loaded, e.g.:

    proxyconnecttimeout 1200;
    proxyreadtimeout 1200;
    proxysendtimeout 1200;
    fastcgireadtimeout 1200;
    fastcgisendtimeout 1200;

    include "/Users//.config/valet/Nginx/*";
    include servers/*;
    include valet/valet.conf;

…but I opted to use include and load a configuration file that way.

I also review some updates to my last video on my XDebug configuration and how I also configured PHP timeouts to also be higher.

Just replaced Safari with Orion on my Mac and my iPhone (See Update)

Update, Dec 5, 2022 8:49 AM: Turns out Orion doesn’t have form autofill, something I have to have.

Maybe if they bring this to Orion, I’ll try again…

  • Yup, I’ve been demoing Orion as a possible replacement for Safari (without losing many of the features of Safari) for weeks now, and moments ago Orion became my daily driver for both my Mac and my iPhone.

Note, it is not my daily driver for development. I recently switched to Vivaldi for that.

A few things I have been loving about Orion:

It’s Safari

Under the hood it’s basically running Webkit, and of course on iOS it’s obviously running the same. This means I don’t lose out on features like selecting text in images/video, etc.

Compact toolbar

Orion compact toolbar

I like normal tabs and I don’t want my UI taking up a ton of space. Orion features a truly compact toolbar and nice rounded tabs.

Profiles for Orion

I’m also not sure what I will do with this feature (separate profiles, think Firefox containers), but it might come in handy later…

Tab Groups / Manage Windows

Tab groups in Orion

One thing I love about Safari is the Tab Group features. Orion does the same thing called Manage Windows, and it even opens a new window for the session vs. switching away from your active session.

Reading List

Reading list still works in Orion

I didn’t lose out on the Reading List feature of Safari either.

Reading List Manager in Orion

You can even manage your reading list, which is a huge improvement over Safari!

Ad blocking built-in

I had to download an extension to get ad-blocking into Safari. Orion comes with it built-in!

Extensions

I don’t usually use extensions much in Safari for casual browsing (except for ad-blocking). But I have confirmed that you can install Chrome & Firefox extensions.

iOS

Now that you can set a default browser in iOS, there are a few features I really like about the iOS app.

Touch-ID protected private mode

Sometimes I want to look at websites without my family accidentally seeing it, especially with my kids grabbing my phone to listen to Taylor Swift. Not only can you have private tabs, but you can also put them behind your fingerprint. Nice.

I know what you’re thinking… stop.

Rich Settings

The settings in the iOS app have just about everything, down to the user-agent used, etc.

Rich settings in Orion for iOS

Extensions

I haven’t played around with this either, but being able to use extensions in iOS is nice.

.com and @ in my keyboard

Keyboard in Orion for iOS

Having these little symbols in my

Vivaldi

I’ve been going back to G00gle Chrome for it’s Devtools too-often after switching to FF DE for my main dev browser. It makes me wonder if I should go back.

Vivaldi to the rescue! It’s come a long way and is a Chromium-based browser. I’ll be trying the switch this week!

It’s super customizable!

And this split-view thing is going to come in super-handy.