March 29, 2024
Laravel Herd is a fantastic application from the Germans wizards at Beyondco.de that makes it so easy to run PHP applications on your Mac or Windows machine. They offer a paid Pro version that provides MySQL, Meilisearch full text search, Redis, and more. I've been running those with Homebrew, and I wanted to consolidate my tooling.
1mysqldump -u root --all-databases > ~/homebrew-mysqldump.sql2brew services stop mysql
Then install the MySQL service with Laravel Herd Pro and start it. You're ready to import your data:
1mysql -u root < ~/homebrew-mysqldump.sql
If all went well, go ahead and remove the Homebrew MySQL:
1brew uninstall mysql2rm ~/homebrew-mysqldump.sql
Since I treat Redis as a transient data store on my development machine, I didn't have any data to transfer. This was as easy as:
1brew services stop redis2brew uninstall redis
And then I installed Redis using Laravel Herd Pro. No changes were required in my .env
file.
Meilisearch is a full text search engine, similar to Elasticsearch. It integrates nicely with Laravel Scout. I do store some data here, but it can be rebuilt, so no need to back anything up.
1brew services stop meilisearch2brew uninstall meilisearch
Install and start Meilisearch with Laravel Herd Pro, then rebuild the indexes:
1php artisan scout:sync-index-settings2php artisan scout:import "class name"
I did need to update my .env
file to include a password. You can see the .env
config in the Laravel Herd Pro settings:
1SCOUT_DRIVER=meilisearch2MEILISEARCH_HOST=http://127.0.0.1:77003MEILISEARCH_KEY=LARAVEL-HERD