bookmark = $bookmark; } /** * Execute the job. * * @return void */ public function handle(Browsershot $browsershot, Client $client) { //save a local screenshot $uuid = Uuid::uuid4(); $browsershot->url($this->bookmark->url) ->windowSize(960, 640) ->save(public_path() . '/assets/img/bookmarks/' . $uuid . '.png'); $this->bookmark->screenshot = $uuid; //get an internet archive link $response = $client->request('GET', 'https://web.archive.org/save/' . $this->bookmark->url); if ($response->hasHeader('Content-Location')) { if (starts_with($response->getHeader('Content-Location')[0], '/web')) { $this->bookmark->archive = $response->getHeader('Content-Location')[0]; } } //save $this->bookmark->save(); } }