Skip to content

Conversation

@dinhquochan
Copy link
Contributor

@dinhquochan dinhquochan commented Nov 28, 2022

Currently, if we use the AsCommand attribute, it will not be set to $description of the class, because Laravel command overrides this property.

This PR will allow us to use AsCommand to set the description of the command class.

ExampleCommand.php using AsCommand:

<?php namespace App\Console\Commands; use Illuminate\Console\Command; use Symfony\Component\Console\Attribute\AsCommand; #[AsCommand('example', 'This is an example command')] class ExampleCommand extends Command { //  }

Before the PR

image

After the PR

image

Thanks.

@dinhquochan dinhquochan changed the title [9.x] Allows set command description via AsCommand attribute [9.x] Allow set command description via AsCommand attribute Nov 28, 2022
@laravel laravel deleted a comment from xuandung38 Nov 28, 2022
@laravel laravel deleted a comment from huynt57 Nov 28, 2022
@laravel laravel deleted a comment from datlechin Nov 28, 2022
@driesvints
Copy link
Member

Please keep the conversation on-topic and use the 👍 if you like the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants