Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

Create progress bar with Laravel

public function handle()
{
     $datas = Model::all();
 
     $bar = $this->output->createProgressBar($datas->count());
 
     $datas->each(function ($data) use ($bar) {
         try {
             // do something
         } catch (Exception $e) {
             $this->error('Error');
         }
 
         $bar->advance();
     });
}
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #Create #progress #bar #Laravel
ADD COMMENT
Topic
Name
7+3 =