public function takeScreenshowOfWebsite($url) { // dd(public_path().'/screenshots/'. str_slug($url) . '.jpg'); $browsershot = new Browsershot(); $path = public_path() . '/screenshots/' . str_slug($url) . '.jpg'; if (!file_exists($path)) { $browsershot->setURL($url)->setWidth('1024')->setHeight('768')->save($path); } return '/screenshots/' . str_slug($url) . '.jpg'; }