lorisleiva / laravel-actions

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

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

Closed leandrodiogenes closed 1 year ago

leandrodiogenes commented 1 year 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.