From 8650d88a794497543b1333f3e4ad5ea9bf753071 Mon Sep 17 00:00:00 2001 From: floppydiskette Date: Thu, 8 Aug 2024 15:21:30 +0100 Subject: Finish that shit --- app/View/Components/Weather.php | 44 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 app/View/Components/Weather.php (limited to 'app/View/Components/Weather.php') diff --git a/app/View/Components/Weather.php b/app/View/Components/Weather.php new file mode 100644 index 0000000..69be9fd --- /dev/null +++ b/app/View/Components/Weather.php @@ -0,0 +1,44 @@ +json(); + $conditions = $data["data"]["conditions"]; + Cache::put('weather_data', $conditions, now()->addSeconds(60)); + return $conditions; + } + + /** + * Get the view / contents that represent the component. + */ + public function render(): View|Closure|string + { + return view('components.weather', [ + 'conditions' => $this->getWeatherData(), + ]); + } +} -- cgit v1.2.3-54-g00ecf