PHP code example of ms48 / laravel-console-progress-bar

1. Go to this page and download the library: Download ms48/laravel-console-progress-bar library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

ms48 / laravel-console-progress-bar example snippets


Ms48\LaravelConsoleProgressBar\ConsoleProgressBarProvider::class,

'ConsoleProgressBar' => Ms48\LaravelConsoleProgressBar\Facades\ConsoleProgressBar::class,

// calling the Facades
use ConsoleProgressBar;

// calling the progressbar
$limit = 20;
$total = Model::get()->count(); //get total recodes

//looping through the result array and show the progress bar
foreach($resultArr as $row)
{
  //some codes
  
  ConsoleProgressBar::showProgress($limit, $total);
}

ConsoleProgressBar::showProgress($limit, $total, $size);