martysmarty

GetImages

Jan 2nd, 2019
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.49 KB | None | 0 0
  1.     public function handle()
  2.     {
  3.         Log::useFiles(storage_path("/logs/iTunes_images.log"));
  4.         Log::info('Debug');
  5.  
  6.         $shows = itunesshows::where("sitesid", "=", 26)->whereNull("image_id")->take(1000)->get();
  7.  
  8.         foreach($shows as $show){
  9.  
  10.             $x = new images();
  11.  
  12.             $x->image_data = base64_encode(file_get_contents($show->image_url));
  13.  
  14.             $x->save();
  15.  
  16.             $show->image_id = $x->id;
  17.             $show->save();
  18.  
  19.         }
  20.     }
Add Comment
Please, Sign In to add comment