option('table'); $bookTitles = BookTitle::orderBy('sn')->get(); $bar = $this->output->createProgressBar(count($bookTitles)); foreach ($bookTitles as $key => $value) { # code... if($table === 'all' || $table ==='fts'){ FtsText::where('book',$value->book) ->where('paragraph','>=',$value->paragraph) ->update(['pcd_book_id'=>$value->sn]); } if($table === 'all' || $table ==='wbw'){ WbwTemplate::where('book',$value->book) ->where('paragraph','>=',$value->paragraph) ->update(['pcd_book_id'=>$value->sn]); } if($table === 'all' || $table ==='pali_text'){ PaliText::where('book',$value->book) ->where('paragraph','>=',$value->paragraph) ->update(['pcd_book_id'=>$value->sn]); } if($table === 'all' || $table ==='page_number'){ PageNumber::where('book',$value->book) ->where('paragraph','>=',$value->paragraph) ->update(['pcd_book_id'=>$value->sn]); } $bar->advance(); } $bar->finish(); return 0; } }