Skip to content

[13.x] Add additional Artisan attributes for usage, help, hidden and isolated#59195

Open
ziadoz wants to merge 11 commits intolaravel:13.xfrom
ziadoz:artisan-attributes
Open

[13.x] Add additional Artisan attributes for usage, help, hidden and isolated#59195
ziadoz wants to merge 11 commits intolaravel:13.xfrom
ziadoz:artisan-attributes

Conversation

@ziadoz
Copy link
Contributor

@ziadoz ziadoz commented Mar 13, 2026

This PR extends the PHP attribute support added in #58578 to cover $help, $hidden, $isolated/$isolatedExitCode on Artisan commands, via new #[Help], #[Hidden] and #[Isolated] attributes.

It also adds a #[Usage] attribute, for providing examples of how commands can be used when using --help.

#[Signature('example:cmd {user} --force')]
#[Description('An example Artisan command')]
#[Help('Performs imaginery work for the purposes of demonstration.')]
#[Hidden]
#[Isolated(exitCode: 1)]
#[Usage('example:cmd 1')]
#[Usage('example:cmd 1 --force')]
class ExampleCommand extends Command
{
    public function handle(): void {}
}

@github-actions
Copy link

Thanks for submitting a PR!

Note that draft PRs are not reviewed. If you would like a review, please mark your pull request as ready for review in the GitHub user interface.

Pull requests that are abandoned in draft may be closed due to inactivity.

@ziadoz ziadoz marked this pull request as ready for review March 13, 2026 20:37
Sign up for free to 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.

1 participant