consolidation/site-alias
Site Alias lets Laravel apps give each site its own domain aliases and resolve the correct site from the incoming request, with support for multiple aliases per site and fast lookup caching.
Architecture fit
consolidation/site-alias is a framework-agnostic PHP library, not a Laravel package. It ships no service provider, no facade, no publishable config, and no Laravel contracts. Its job is narrow and well-defined: discover *.site.yml alias files across a set of search paths, parse and merge them (including @self, @parent, @none inheritance and env-style variable interpolation), and expose typed AliasRecord objects with resolved root/uri plus a spec array. It is the canonical alias engine behind Drush and Pantheon Terminus.
For a Laravel codebase this is a "library you wrap," not a "package you install and configure." The realistic fit is a Laravel app that already operates on Drupal/Drush estates — a multi-site control panel, a deployment dashboard, a backup/sync orchestrator, a CI helper service. In a pure Laravel product with no Drush footprint, there is no problem here to solve and the package adds surface area for nothing.
Integration feasibility
Mechanically low cost. composer require consolidation/site-alias, construct a SiteAliasManager with one or more search locations, and you have a typed API replacing ad-hoc YAML globbing or shelling out to drush sa --format=json. The main integration work is not the library — it is deciding where alias files live in your runtime (repo path, mounted volume, object storage sync) and making that location configurable rather than hardcoded.
Technical risk
.site.yml format will misread behavior — particularly inheritance resolution order and @self fallback.Key questions
Stack fit
Wrap it, do not scatter it. A thin SiteAliasServiceProvider binds a singleton SiteAliasManager built from a config/site-alias.php search-path list, exposed behind a small application-level interface (AliasRepository::all(), ::get($name)). Consumers depend on your interface, not on AliasRecord, which keeps the vendor type out of your domain and makes a later swap to a hand-rolled parser a one-file change. Wrap access in Laravel's cache with a file-mtime-aware key so discovery does not run on every request.
Migration path
Identify every place the app currently shells out to drush sa, globs *.site.yml, or hand-parses YAML for host/root/uri. Replace those with the repository interface, in that order of confidence — the shell-out call sites are the best evidence the library is earning its place (you delete a subprocess and a parsing failure mode at once). Leave anything that only needs one or two static fields alone; the library is not worth a dependency for reading a single hardcoded hostname.
Compatibility
Check PHP constraint against your runtime floor, and — more importantly — symfony/yaml version range against what Laravel's ecosystem already resolves. YAML is the most likely conflict point; if you cannot align, stop and reconsider. Pin to an exact minor version rather than a caret range until you have run a full upgrade cycle against it.
Sequencing
Maintenance
Low ongoing code maintenance — the library does one thing. The real cost is format stewardship: someone must own the alias files, their schema, and their review process. Budget a few hours per quarter for dependency bumps and a re-read of upstream changes, more if you rely on inheritance.
Support
Thin. Expect GitHub issues rather than a vendor. Internal documentation is mandatory, specifically a short page on the alias file format and resolution order. Do not assume a new hire can infer behavior from the code.
Scaling
Discovery is O(files × parse cost) per uncached call. At tens of aliases this is trivial; at hundreds across many search paths in a request path it is not. Cache aggressively, key on directory mtime, and keep the manager out of hot request paths entirely — resolve aliases at deploy/queue time and persist the flattened result.
Failure modes
${env.X} yields literal or null values that surface far from the cause. Validate resolved fields at the boundary.@self fallback and @parent chains can silently point at the wrong site. Test the resolution order explicitly.Ramp-up
A Laravel developer can integrate this in under a day. The non-obvious cost is domain literacy: understanding Drush alias semantics, inheritance, and where files come from in your topology. That is a half-day of reading plus one paired session with whoever owns the Drupal estate. Without that person, do not proceed.
How can I help you explore Laravel packages today?