Example #1
0
 /**
  * Rebuild a specific repository
  * 
  * @param \Illuminate\Database\Eloquent\Model $modelRepository
  * 
  * @return void
  */
 public function rebuildRepository(Model $modelRepository)
 {
     $count = $modelRepository->count();
     if ($count < 1) {
         return $this->comment(' No available models found.');
     }
     $progress = new ProgressBar($this->getOutput(), ++$count);
     $modelRepository->chunk(200, function ($models) use($progress) {
         $this->rebuildModels($models->all(), $progress);
     });
     $progress->finish();
 }
Example #2
0
 /**
  * {@inheritdoc}
  */
 public function chunk($size, $callback)
 {
     $this->model->chunk($size, $callback);
 }