2017 © Pedro Peláez
 

library laravel-progress-command

A simple command which outputs progress to the console.

image

elipettingale/laravel-progress-command

A simple command which outputs progress to the console.

  • Friday, May 25, 2018
  • by elipettingale
  • Repository
  • 1 Watchers
  • 0 Stars
  • 91 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 7 Versions
  • 727 % Grown

The README.md

Laravel Progress Command

A simple command which outputs progress bars to the console., (*1)

Will output various progress bars which will be updated depending on the key returned by the the fireItem() function., (*2)

Example

class TestCommand extends ProgressCommand implements HasInfoBar
{
    protected $signature = 'test-command';

    protected function getItems()
    {
        return ['One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten'];
    }

    protected function fireItem($item): string
    {
        sleep(1);

        return array_random(['success', 'error']);
    }

    public function getItemIdentifier($item): string
    {
        return $item;
    }

    protected function getProgressBarBlueprints(): array
    {
        return [
            new ProgressBarBlueprint('success', 'Success', [
                'foreground' => 'green'
            ]),
            new ProgressBarBlueprint('error', 'Error', [
                'foreground' => 'red'
            ])
        ];
    }
}

ProgressBarBlueprint

These are how you define the progress bars that get printed to the console. Each blueprint must have a 'key', which is used to identify which progress bar to increment by the fireItem method, and a 'description' which is free text that is used as a label for the progress bar., (*3)

The Versions

25/05 2018

dev-develop

dev-develop

A simple command which outputs progress to the console.

  Sources   Download

MIT

The Requires

 

by Elliot Pettingale

25/05 2018

dev-master

9999999-dev

A simple command which outputs progress to the console.

  Sources   Download

MIT

The Requires

 

by Elliot Pettingale

25/05 2018

v2.1.2

2.1.2.0

A simple command which outputs progress to the console.

  Sources   Download

MIT

The Requires

 

by Elliot Pettingale

25/05 2018

v2.1.1

2.1.1.0

A simple command which outputs progress to the console.

  Sources   Download

MIT

The Requires

 

by Elliot Pettingale

25/05 2018

v2.1

2.1.0.0

A simple command which outputs progress to the console.

  Sources   Download

MIT

The Requires

 

by Elliot Pettingale

25/05 2018

v2.0

2.0.0.0

A simple command which outputs progress to the console.

  Sources   Download

MIT

The Requires

 

by Elliot Pettingale

18/05 2018

v1.0

1.0.0.0

A simple command which outputs progress to the console.

  Sources   Download

MIT

The Requires

 

by Elliot Pettingale