/** * Execute the job. * * @throws EmptyResponse */ public function handle() { $response = $this->instagram->getUserMedia($this->user, $this->limit); if (empty($response)) { throw new EmptyResponse(); } if ($response->meta->code !== 200) { throw new \Exception($response->meta->error_message); } event(new FeedWasFetched($response, 'instagram')); return $response; }