lorisleiva / laravel-actions

⚡️ Laravel components that take care of one specific task
https://laravelactions.com
MIT License
2.52k stars 124 forks source link

Make InteractsWithIO::$components protected property accessible on CommandDecorator #206

Closed leandrodiogenes closed 2 years ago

leandrodiogenes commented 2 years ago

see #205

That pull request makes possible to access Illuminate\Console\Command::$components protected property from asCommand method.

namespace App\Actions;

use Illuminate\Console\Command;

class ConsoleTestAction extends Action {
    public string $commandSignature = 'test-action';

    public function asCommand(Command $command): void {
        $command->getComponents()->info('Done!');
    }
}

Result: image

I dont know if is the best choice. Maybe the best way is to open a pull request on laravel repo.