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
I found a path-handling issue in
tighten/ziggyv2.6.1.ziggy:generateappears to wrap both the main output path and the types output path inbase_path(...)unconditionally.That means an absolute path like
/tmp/ziggy.jsis treated as relative to the Laravel app root instead of being written to/tmp/ziggy.js.Repro
Expected output path:
Actual output path:
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.phpbase_path($path)/base_path("{$name}.js")/base_path($typesPath)calls