friendsofhyperf/console-spinner

The progress bar component For Hyperf.

Maintainers

πŸ‘ huangdijia

Package info

github.com/friendsofhyperf/console-spinner

Issues

Documentation

pkg:composer/friendsofhyperf/console-spinner

Fund package maintenance!

huangdijia

hdj.me/sponsors

Statistics

Installs: 4 455

Dependents: 0

Suggesters: 0

Stars: 1

v3.2.1 2026-06-09 14:51 UTC

Requires

Requires (Dev)

None

Suggests

None

Provides

None

Conflicts

None

Replaces

None

MIT 8db025101dc2f5ed1d82e23ec1f0a7cd984b4bda

  • huangdijia <huangdijia.woop@gmail.com>

hyperfv3.2

This package is auto-updated.

Last update: 2026-06-17 01:07:05 UTC


README

δΈ­ζ–‡θ―΄ζ˜Ž

πŸ‘ Latest Stable Version
πŸ‘ Total Downloads
πŸ‘ License

The progress bar component For Hyperf.

Installation

composer require friendsofhyperf/console-spinner

Publish

  • Optional
php bin/hyperf.php vendor:publish friendsofhyperf/console-spinner

Usage

class FooCommand extends Command
{
 use Spinnerable;

 /**
 * Execute the console command.
 *
 * @return void
 */
 public function handle()
 {
 $spinner = $this->spinner($users->count());
 $spinner->setMessage('Loading...');
 $spinner->start();
 
 foreach ($users as $user) {
 // Do your stuff...
 
 $spinner->advance();
 }

 $spinner->finish();
 }
}

The $spinner is compatible with Symfony ProgressBar, so you can run any method of this class.

Or you can also use with withSpinner method by giving an iterable.

$this->withSpinner(User::all(), function($user) {
 // Do your stuff with $user
}, 'Loading...');

Contact

License

MIT