diff options
author | floppydiskette <floppydisk@hyprcat.net> | 2024-11-28 00:07:08 +0000 |
---|---|---|
committer | floppydiskette <floppydisk@hyprcat.net> | 2024-11-28 00:07:08 +0000 |
commit | f5444a9bf66cc88244a2b2c6ceca385f1e201f09 (patch) | |
tree | 65c65580491848b64fd461541f79889ce51b4b74 /app/View | |
parent | 1d39acd29871bd059dc62a003956cb98a8264505 (diff) |
Sure is a new site design
Diffstat (limited to 'app/View')
-rw-r--r-- | app/View/Components/wah.php | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/app/View/Components/wah.php b/app/View/Components/wah.php new file mode 100644 index 0000000..c8ee36c --- /dev/null +++ b/app/View/Components/wah.php @@ -0,0 +1,39 @@ +<?php + +namespace App\View\Components; + +use Closure; +use Illuminate\Contracts\View\View; +use Illuminate\Support\Facades\Cache; +use Illuminate\Support\Facades\Config; +use Illuminate\Support\Facades\Http; +use Illuminate\View\Component; + +class Wah extends Component +{ + /** + * Create a new component instance. + */ + public function __construct() {} + + + public function getWah(): string { + try { + $response = Http::get('https://api.tinyfox.dev/img.json?animal=wah'); + $data = $response->json(); + return "https://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(), + ]); + } +} |