All Projects → RahulDey12 → laravel-console-spinner

RahulDey12 / laravel-console-spinner

Licence: MIT license
Customized loading ⌛ spinner for Laravel Artisan Console.

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to laravel-console-spinner

Python Progressbar
Progressbar 2 - A progress bar for Python 2 and Python 3 - "pip install progressbar2"
Stars: ✭ 682 (+874.29%)
Mutual labels:  console, progress-bar
Tqdm
A Fast, Extensible Progress Bar for Python and CLI
Stars: ✭ 20,632 (+29374.29%)
Mutual labels:  console, progress-bar
progress-bar-log
A component to display a progress bar and last X logs at the same time.
Stars: ✭ 44 (-37.14%)
Mutual labels:  console, progress-bar
Yurnalist
An elegant console reporter, borrowed from Yarn
Stars: ✭ 88 (+25.71%)
Mutual labels:  console, progress-bar
Inquirer.cs
A collection of common interactive command line user interfaces. Port of Inquirer.js
Stars: ✭ 26 (-62.86%)
Mutual labels:  console
go-color
A lightweight, simple and cross-platform package to colorize text in terminals
Stars: ✭ 65 (-7.14%)
Mutual labels:  console
circlebars
Add circular progress bars and countdown timers easily with circlebars Created by @itaditya. Demo at >
Stars: ✭ 38 (-45.71%)
Mutual labels:  progress-bar
tvoip
Terminal-based P2P VoIP application (TeamSpeak-/Skype-like voice chatting over LAN or Internet)
Stars: ✭ 34 (-51.43%)
Mutual labels:  console
log-utils
Basic logging utils: colors, symbols and timestamp.
Stars: ✭ 24 (-65.71%)
Mutual labels:  console
yachalk
🖍️ Terminal string styling done right
Stars: ✭ 131 (+87.14%)
Mutual labels:  console
congif
convert script(1) output to GIF
Stars: ✭ 52 (-25.71%)
Mutual labels:  console
multitextor
Multiplatform command line text editor.
Stars: ✭ 27 (-61.43%)
Mutual labels:  console
douban.fm
简洁的豆瓣电台命令行版。
Stars: ✭ 13 (-81.43%)
Mutual labels:  console
laravel-make-me
Extendable Interactive Make Command for Laravel
Stars: ✭ 36 (-48.57%)
Mutual labels:  console
CLI-Autocomplete
Cross-platform flexible autocomplete library for your CLI applications.
Stars: ✭ 21 (-70%)
Mutual labels:  console
Lua-Obfuscator
Obfuscate your lua code because it's so easy to steal!
Stars: ✭ 69 (-1.43%)
Mutual labels:  console
std
stdout, for humans.
Stars: ✭ 17 (-75.71%)
Mutual labels:  console
oof
Convenient, high-performance RGB color and position control for console output
Stars: ✭ 764 (+991.43%)
Mutual labels:  console
barecolor
A tiny JavaScript utility for printing colorful console messages.
Stars: ✭ 20 (-71.43%)
Mutual labels:  console
leeks.js
Simple ANSI styling for your terminal
Stars: ✭ 12 (-82.86%)
Mutual labels:  console

Laravel Console Spinner

Laravel Console Spinner was created by Rahul Dey. It is just a custom Progress Bar inspired by icanhazstring/symfony-console-spinner.

StyleCI Status Total Downloads Version PHP Version Require

Installation

Requires PHP 7.3+

Via Composer:

composer require rahul900day/laravel-console-spinner

You can publish the config file with:

php artisan vendor:publish --tag=console-spinner-config

This is the contents of the published config file:

return [
    'chars' => ['⠏', '⠛', '⠹', '⢸', '⣰', '⣤', '⣆', '⡇'],
];

Usage

class SimpleLaravelCommand extends Command
{
    /**
     * 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...');

Licence

This package is released under the MIT license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].