Streamlining Laravel Developer Onboarding with a Makefile and Herd Pro

Speed up Laravel onboarding with a developer Makefile. Learn how to automate your Herd Pro setup, install dependencies, seed databases, and improve consistency for new team members.

Steven Richardson
Steven Richardson
· 4 min read

One of Laravel’s greatest strengths has always been the developer experience. From installing packages to integrating with third-party services, Laravel is expressive, intuitive, and polished.

Back in the days of Homestead, I admired how easily Laravel could be spun up locally. So much so, I built my own version for Magento, called Magestead. Fast forward to today, and we’ve transitioned to more elegant and native tooling. For me and many others, Herd Pro is now the go-to local development environment.

Herd Pro makes managing services like MySQL, Redis, Meilisearch, and Laravel Reverb effortless, and supports project-level configurations through a herd.yml file.

Why Onboarding Matters#

While Herd simplifies setup, onboarding new developers can still involve many manual steps—installing dependencies, configuring the environment, and seeding the database.

The goal? Clone the repo, run one command, and you’re up and running. This is where a Makefile shines.

What Is a Makefile?#

At its core, a Makefile is a file containing rules for automating repetitive shell commands. Ideal for onboarding, it reduces multi-step instructions to a single, predictable command.

Here’s an example of a Makefile in the root of your Laravel project:

.PHONY: install

install:
 @(herd init)
 @(composer install)
 @(npm ci)
 @(npm run build)
 @DIR=$$(basename $$(pwd)); \
 mysql -h 127.0.0.1 -uroot -e "CREATE DATABASE IF NOT EXISTS $${DIR}"
 @(php artisan migrate:fresh --seed)

update:
 @(composer install)
 @(npm ci)
 @(npm run build)

One Command Setup#

For a new developer, setup is as simple as:

git clone {repo} {dir}
cd {dir}
make install

Let’s break it down:

herd init#

  • Read your herd.yml config
  • Copies .env.example to .env
  • Installs all defined services

Example output:

INFO  PHP 8.4 is installed.
INFO  Site is secured.
INFO  Mysql is running on port 3306
INFO  Redis is running on port 6379
DONE  Your application is ready to go!

Composer & NPM#

Next, we install back-end and front-end dependencies:

composer install
npm ci
npm run build

With Herd Pro, managing Node versions is automatic via your .nvmrc file.

Auto-Creating the Database#

@DIR=$$(basename $$(pwd))
mysql -h 127.0.0.1 -uroot -e "CREATE DATABASE IF NOT EXISTS $${DIR}"

This line uses the current folder name as the database name—ideal if you’re following a convention where each project directory matches your .env DB name.

Swap mysql for psql or other commands if you’re using PostgreSQL or SQLite.

App Key, Migrations & Seeds#

We assume there’s no app key, so we generate one:

php artisan key:generate
php artisan migrate:fresh --seed

At this point, a developer can load the app in their browser and log in with default seeded credentials.

Keeping Things Updated#

We also include an update command:

make update

This handles:

  • Composer/NPM dependency syncing
  • Rebuilding frontend assets

Useful for returning developers unsure of what's changed.

Conclusion#

By introducing a simple Makefile, you can transform a 15-step onboarding guide into a single make install. Combined with Herd Pro, it ensures Laravel developers spin up consistent, working environments in minutes.

It improves productivity, reduces errors, and maintains parity across your team—no more "works on my machine" problems.

This Makefile approach fits naturally into The Complete Laravel Developer Toolchain for 2026, which covers the full stack of local environment, IDE, code quality, testing, and deployment tools. If your team works with Docker in addition to Herd, optimising Laravel Docker images with multi-stage builds keeps your production images lean while keeping local development fast. To enforce code style automatically from the moment a developer clones the repo, add Laravel Pint with Git pre-commit hooks as a make install step so formatting is enforced before the first commit.

FAQ#

Why not just document the setup steps in a README instead of using a Makefile?

Documentation is necessary but it relies on developers reading and following instructions manually. A Makefile removes that cognitive load and human error — one command does the whole sequence consistently. Plus, Makefiles are universally available on macOS and Linux, so there's no added dependency. Documentation still matters (explain why developers need to run these steps), but automation handles the how.

What if my project uses SQLite instead of MySQL?

Update the database creation line in your Makefile to match your database driver. For SQLite, you can skip the CREATE DATABASE step entirely since SQLite databases are just files — php artisan migrate:fresh --seed creates the database file automatically. For PostgreSQL, replace mysql with psql and adjust the connection parameters to your Postgres setup.

Can I add other steps to the Makefile, like running seeders or creating test data?

Absolutely. Extend make install to include any step that belongs in fresh setup — API key generation, third-party service configuration, cache warming, or running specific seed classes. You can also create additional targets like make seed-test-data for developers who want to populate fresh data without running the full install. Each target is just a sequence of shell commands.

How do I handle environment-specific configurations in the Makefile?

Use environment variables or create separate Makefile targets. For example, make install-local could set different variables than make install-staging. You can also conditionally source different .env files based on the target, or ask for input during the setup with @read -p "Enter your API key: " API_KEY. Keep sensitive data out of the Makefile itself — use .env or .env.local for secrets.

Steven Richardson
Steven Richardson

CTO at Digitonic. Writing about Laravel, architecture, and the craft of leading software teams from the west coast of Scotland.