/** * Execute the job. * * @return void */ public function handle(ImageDownloadService $downloader) { $filename = md5($this->user->twitter_id); $image_path = $downloader->saveImage($this->user->avatar, $filename, 400, 400); $this->user->avatar = $image_path; $this->user->save(); }
/** * Execute the job. * * @return void */ public function handle(FeedService $parser, ImageDownloadService $downloader) { $feed = $parser->loadDetailsFromRss($this->podcast->feed); $this->podcast->name = $feed['title']; $this->podcast->url = $feed['link']; $this->podcast->description = $feed['summary']; $image_path = $downloader->saveImage($feed['image'], md5($this->podcast->feed), 600, 600); if ($image_path != null) { $this->podcast->coverimage = $image_path; } if ($this->podcast->name == null) { $this->podcast->error = 17; // podcast could not be parsed error } $this->podcast->save(); }