ziggy:generate rebases absolute output paths under base_path() instead of writing to the requested location
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 78/100
Research direction
Start by reading src/CommandRouteGenerator.php and trace the ziggy:generate handling for the main output, default name, and types paths. Reproduce the command with an absolute path, then verify that absolute locations are used as requested rather than rebased under the application base path.
Written by the indexing model from the issue text.
Description
I found a path-handling issue in tighten/ziggy v2.6.1.
ziggy:generate appears to wrap both the main output path and the types output path in base_path(...) unconditionally.
That means an absolute path like /tmp/ziggy.js is treated as relative to the Laravel app root instead of being written to /tmp/ziggy.js.
Repro
php artisan ziggy:generate /tmp/ziggy-audit-exists/ziggy.js
Expected output path:
/tmp/ziggy-audit-exists/ziggy.js
Actual output path:
<project root>/tmp/ziggy-audit-exists/ziggy.js
Expected
Absolute paths should be honored as-is.
Actual
Absolute paths are silently rebased under the application base path.
Why this matters
This is easy to miss in automation/CI scripts because the command succeeds, but the file is written to the wrong place.
Relevant code
src/CommandRouteGenerator.php- the
base_path($path)/base_path("{$name}.js")/base_path($typesPath)calls
- Dominant language
- JavaScript
- Stars
- 4.3k
- Forks
- 273
- PR merge metrics
- No merged PRs in 30d
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from tighten/ziggy
-
Difficulty 4/5 3-5 days Newbie friendliness 58/100
-
Difficulty 4/5 3-5 days Newbie friendliness 48/100
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
HarperFast/skills#96 ·
-
[Block] Latest Posts [Type] Bug
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Automattic/studio#4908 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
sugarlabs/musicblocks#8847 ·