Skip to content

Add Lerd support - #675

Open
geodro wants to merge 1 commit into
laravel:mainfrom
geodro:feat/lerd-php-environment
Open

Add Lerd support#675
geodro wants to merge 1 commit into
laravel:mainfrom
geodro:feat/lerd-php-environment

Conversation

@geodro

@geodro geodro commented Jul 8, 2026

Copy link
Copy Markdown

Adds Lerd to the list of detectable PHP environments, alongside Sail, Lando, and DDEV.

Lerd is an open-source, Herd-like local PHP development environment for Linux and macOS that runs Nginx, PHP-FPM, and services as rootless Podman containers. It exposes lerd php to run PHP inside a project's container, which is all the extension needs to resolve the environment.

The entry follows the existing containerized pattern:

  • check: lerd php -r "echo PHP_BINARY;" to detect that Lerd manages the project
  • command: lerd php
  • relativePath: true, since PHP runs inside a container

One simplification worth noting: Lerd bind-mounts the project at its identical host path and runs lerd php with the container working directory set to the project root, so host and container paths line up 1:1. That means Lerd needs no entry in pathForPhpEnv, unlike DDEV which strips its /var/www/html/ prefix.

The Laravel.phpEnvironment enum, labels, and descriptions in package.json are updated to match, mirroring what generate-php-envs.php produces from the new entry.

@geodro

geodro commented Sep 1, 2026

Copy link
Copy Markdown
Author

@joetannenbaum sorry for the ping, I know the queue is long. This one is small, same shape as the Sail and DDEV entries, no conflicts.

lerd has grown quite a bit since July, around 1.2k stars now, and people on Linux keep hitting the extension not resolving their PHP.

The only difference from the others is that lerd bind-mounts at the same path as the host, so it doesn't need a pathForPhpEnv entry like DDEV does. If you'd rather keep all environments consistent there I can add one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant