Skip to content

Generate the types file when --types is passed as a boolean - #892

Closed
lazerg wants to merge 1 commit into
tighten:2.xfrom
lazerg:fix/issue-879-types-boolean-flag
Closed

Generate the types file when --types is passed as a boolean#892
lazerg wants to merge 1 commit into
tighten:2.xfrom
lazerg:fix/issue-879-types-boolean-flag

Conversation

@lazerg

Copy link
Copy Markdown
Contributor

Passing --types as a boolean (e.g. Artisan::call('ziggy:generate', ['--types' => true]), which is the convention Laravel documents for boolean options) coerces the value to the string "1", which then falls through the match in CommandRouteGenerator and gets used as the types file's path, so the declaration file is written to a file named 1 in the project root instead of at the default location. This adds the coerced boolean value to the arm that already handles false/null, so a boolean --types generates the types file at the default path as expected.

Closes#879.

@bakerkretzmarbakerkretzmar self-assigned this Jul 7, 2026
@lazerg

lazerg commented Aug 8, 2026

Copy link
Copy Markdown
ContributorAuthor

@bakerkretzmar since you already reviewed #891, mind taking a look at this one too?

@lazerglazerg closed this by deleting the head repository Aug 26, 2026
@lazerg

Copy link
Copy Markdown
ContributorAuthor

I deleted the fork by accident, which force-closed this PR with no way to reopen it. Restored the branch and reopened it as #896, same commit.

Sign up for freeto 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.

New --types flag behavior breaks Laravel convention

2 participants

@lazerg@bakerkretzmar