Laravel family router
This family package is self-contained. It routes a Laravel request to one
version reference and keeps version-specific guidance out of the initial
prompt until the selector is known.
Resolve the selector
Use this order and stop at the first decisive result:
- Explicit selector — honor the caller's version without reading a
project file. Supported selectors are
5.4, 6, 7, 8, 9, 10,
11, and mix. The compatibility aliases 5-4, laravel-5.4,
laravel-5-4, laravel-mix, and mix-5 normalize to 5.4 or mix.
- Project detection — if no selector was supplied, read the current
project's
composer.lock, then composer.json, for
laravel/framework. A package-only asset project may also resolve mix
from package.json when laravel-mix is declared. These files are read
directly by the family-local resolver.
- Ask — if the selector is missing, malformed, unsupported, or
ambiguous, ask which supported selector applies. Never guess a nearby
major or silently use the newest reference.
Project detection never consults dhpk installation or publication manifests.
The family package must continue to work when copied by itself.
Load exactly one reference
After resolution, load only the matching file below. Do not preload sibling
versions. For a cross-version review or upgrade, consult
compatibility.md or migration.md after the selector-specific
reference; those shared notes are not selector targets.
| Selector |
Reference |
5.4 (or 5-4) |
references/5-4.md |
6 |
references/6.md |
7 |
references/7.md |
8 |
references/8.md |
9 |
references/9.md |
10 |
references/10.md |
11 |
references/11.md |
mix (or laravel-mix) |
references/mix.md |
The resolver reports the selected relative reference and its complete file
contents. A successful resolution therefore has exactly one loaded reference;
an ask result has none.
When NOT to Use
- Use
php for Symfony, Yii, or general PHP runtime
selection that is not Laravel-specific.
- Use framework-neutral guidance for frontend-only work; select
mix only
when the project owns the Laravel Mix pipeline described above.
Output
Return the selected Laravel or Mix selector, the one loaded reference, the
applicable PHP/framework floor, and the verification gates from that reference.
For an unresolved or ambiguous project, return the actionable ask and report
that no version reference was loaded.
Verification
- Run
node scripts/resolve-version.js --json [--version <selector>] and
confirm the result names the expected family, selector, source, and
reference.
- Run
php artisan --version or composer show laravel/framework when the
project is available, then compare it with the selected reference.
- For a copied family directory, run the CLI with
NODE_PATH empty and an
explicit selector to prove that resolution has no repository dependency.
The family-local scripts/resolve-version.js is the JSON CLI entrypoint. It
accepts an optional explicit selector and exits non-zero when resolution asks
for input or encounters an error. scripts/version-resolver.js is the
programmatic resolver used by the CLI; it returns the selected reference and
loaded contents, or an ask result with no loaded references.
Apply the selected guidance
- Confirm the installed framework version with
php artisan --version or
composer show laravel/framework when the project is available.
- Check the PHP floor, source-generation layout, and package constraints in the
selected reference before writing framework-coupled code.
- Treat the reference as locked framework documentation, not the application's
policy SSOT. Keep domain and product decisions in the application sources.
- Run the reference's verification gates and report any version mismatch or
unresolved migration trap explicitly.
Mix boundary
mix is an optional upgraded legacy asset-pipeline selector for Laravel Mix 5
and webpack 4. It is not default Laravel framework coupling. Select it for a
project that actually owns webpack.mix.js, laravel-mix, and the associated
npm scripts; otherwise use the Laravel framework selector alone.
Portable package boundary
All resolver imports and reference paths are family-relative. Core resolution
requires no dhpk manifest, hook, agent, MCP server, or repository working state.
1---2name: laravel3description: 'Laravel framework guidance across 5.4, 6, 7, 8, 9, 10, 11, and optional Mix 5. Use when implementing or reviewing framework-touching Laravel code, planning an upgrade, or debugging a version-specific build. Not for Symfony, Yii, or frontend-only work; use php for runtime selection. Output: one selected Laravel or Mix reference, compatibility constraints, and verification gates.'4metadata:5 source: https://skillmd.com/skills/hmj1026/laravel6 dhpk-capability-id: dhpk.skill.laravel7 dhpk-name-style: portable-family8 dhpk-invocation-class: implicit-eligible9---1011# Laravel family router1213This family package is self-contained. It routes a Laravel request to one14version reference and keeps version-specific guidance out of the initial15prompt until the selector is known.1617## Resolve the selector1819Use this order and stop at the first decisive result:20211. **Explicit selector** — honor the caller's version without reading a22 project file. Supported selectors are `5.4`, `6`, `7`, `8`, `9`, `10`,23 `11`, and `mix`. The compatibility aliases `5-4`, `laravel-5.4`,24 `laravel-5-4`, `laravel-mix`, and `mix-5` normalize to `5.4` or `mix`.252. **Project detection** — if no selector was supplied, read the current26 project's `composer.lock`, then `composer.json`, for27 `laravel/framework`. A package-only asset project may also resolve `mix`28 from `package.json` when `laravel-mix` is declared. These files are read29 directly by the family-local resolver.303. **Ask** — if the selector is missing, malformed, unsupported, or31 ambiguous, ask which supported selector applies. Never guess a nearby32 major or silently use the newest reference.3334Project detection never consults dhpk installation or publication manifests.35The family package must continue to work when copied by itself.3637## Load exactly one reference3839After resolution, load only the matching file below. Do not preload sibling40versions. For a cross-version review or upgrade, consult41[`compatibility.md`](compatibility.md) or [`migration.md`](migration.md) after the selector-specific42reference; those shared notes are not selector targets.4344| Selector | Reference |45| --- | --- |46| `5.4` (or `5-4`) | [`references/5-4.md`](references/5-4.md) |47| `6` | [`references/6.md`](references/6.md) |48| `7` | [`references/7.md`](references/7.md) |49| `8` | [`references/8.md`](references/8.md) |50| `9` | [`references/9.md`](references/9.md) |51| `10` | [`references/10.md`](references/10.md) |52| `11` | [`references/11.md`](references/11.md) |53| `mix` (or `laravel-mix`) | [`references/mix.md`](references/mix.md) |5455The resolver reports the selected relative reference and its complete file56contents. A successful resolution therefore has exactly one loaded reference;57an ask result has none.5859## When NOT to Use6061- Use `php` for Symfony, Yii, or general PHP runtime62 selection that is not Laravel-specific.63- Use framework-neutral guidance for frontend-only work; select `mix` only64 when the project owns the Laravel Mix pipeline described above.6566## Output6768Return the selected Laravel or Mix selector, the one loaded reference, the69applicable PHP/framework floor, and the verification gates from that reference.70For an unresolved or ambiguous project, return the actionable ask and report71that no version reference was loaded.7273## Verification7475- Run `node scripts/resolve-version.js --json [--version <selector>]` and76 confirm the result names the expected family, selector, source, and77 reference.78- Run `php artisan --version` or `composer show laravel/framework` when the79 project is available, then compare it with the selected reference.80- For a copied family directory, run the CLI with `NODE_PATH` empty and an81 explicit selector to prove that resolution has no repository dependency.8283The family-local `scripts/resolve-version.js` is the JSON CLI entrypoint. It84accepts an optional explicit selector and exits non-zero when resolution asks85for input or encounters an error. `scripts/version-resolver.js` is the86programmatic resolver used by the CLI; it returns the selected reference and87loaded contents, or an ask result with no loaded references.8889## Apply the selected guidance9091- Confirm the installed framework version with `php artisan --version` or92 `composer show laravel/framework` when the project is available.93- Check the PHP floor, source-generation layout, and package constraints in the94 selected reference before writing framework-coupled code.95- Treat the reference as locked framework documentation, not the application's96 policy SSOT. Keep domain and product decisions in the application sources.97- Run the reference's verification gates and report any version mismatch or98 unresolved migration trap explicitly.99100## Mix boundary101102`mix` is an optional upgraded legacy asset-pipeline selector for Laravel Mix 5103and webpack 4. It is not default Laravel framework coupling. Select it for a104project that actually owns `webpack.mix.js`, `laravel-mix`, and the associated105npm scripts; otherwise use the Laravel framework selector alone.106107## Portable package boundary108109All resolver imports and reference paths are family-relative. Core resolution110requires no dhpk manifest, hook, agent, MCP server, or repository working state.