friendsofhyperf / console-spinner
The progress bar component For Hyperf.
Package info
github.com/friendsofhyperf/console-spinner
pkg:composer/friendsofhyperf/console-spinner
v3.2.0
2026-06-07 13:32 UTC
Requires
- hyperf/command: ~3.2.0
- hyperf/context: ~3.2.0
- hyperf/di: ~3.2.0
- hyperf/support: ~3.2.0
- symfony/console: ^6.0 || ^7.0
- symfony/process: ^6.0 || ^7.0
This package is auto-updated.
Last update: 2026-06-07 13:48:11 UTC
README
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...');