json(); if ($data == null) return ""; $path = parse_url("https://api.tinyfox.dev" . $data["loc"], PHP_URL_PATH); return "//".request()->getHttpHost()."/proxy/wah/".basename($path); } catch (Exception $ex) { return ""; } } try { $response = Http::get('https://api.tinyfox.dev/img.json?animal=wah'); $data = $response->json(); if ($data == null) return ""; return "https://api.tinyfox.dev" . $data["loc"]; } catch (Exception $ex) { return ""; } } /** * Get the view / contents that represent the component. */ public function render(): View|Closure|string { return view('components.wah', [ 'wah' => $this->getWah(), ]); } }