From c801d284469b2fb2ab83f5da3cea80f742c0a284 Mon Sep 17 00:00:00 2001 From: HolgerHatGarKeineNode Date: Fri, 31 Mar 2023 17:51:47 +0200 Subject: [PATCH] mempool weather added --- app/Console/Commands/Test.php | 2 +- app/Http/Livewire/Banner/MempoolWeather.php | 13 - resources/views/layouts/app.blade.php | 1 + resources/views/layouts/guest.blade.php | 1 + .../livewire/banner/mempool-weather.blade.php | 309 ++++++++++-------- 5 files changed, 176 insertions(+), 150 deletions(-) diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index 4f009865..d3b08b57 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -45,6 +45,6 @@ class Test extends Command 'temperature' => 1 ]); - cache()->put('mempool-weather', $result['choices'][0]['text'], now()->addMinutes(60)); + echo $result['choices'][0]['text']; } } diff --git a/app/Http/Livewire/Banner/MempoolWeather.php b/app/Http/Livewire/Banner/MempoolWeather.php index fd8321ef..ac32e963 100644 --- a/app/Http/Livewire/Banner/MempoolWeather.php +++ b/app/Http/Livewire/Banner/MempoolWeather.php @@ -10,12 +10,6 @@ use Livewire\Component; class MempoolWeather extends Component { public string $weather = ''; - - public $fastestFee; - public $halfHourFee; - public $hourFee; - public $economyFee; - public $minimumFee; public $changed; public function mount() @@ -26,13 +20,6 @@ class MempoolWeather extends Component Artisan::call(CacheRecommendedFees::class); $this->weather = cache()->get('mempool-weather'); } - $result = Http::get('https://mempool.space/api/v1/fees/recommended'); - $result = $result->json(); - $this->fastestFee = $result['fastestFee']; - $this->halfHourFee = $result['halfHourFee']; - $this->hourFee = $result['hourFee']; - $this->economyFee = $result['economyFee']; - $this->minimumFee = $result['minimumFee']; $this->changed = cache()->get('mempool-weather-changed'); } diff --git a/resources/views/layouts/app.blade.php b/resources/views/layouts/app.blade.php index 873661f4..9addba18 100644 --- a/resources/views/layouts/app.blade.php +++ b/resources/views/layouts/app.blade.php @@ -14,6 +14,7 @@ @googlefonts + diff --git a/resources/views/layouts/guest.blade.php b/resources/views/layouts/guest.blade.php index 309d44eb..d471776a 100644 --- a/resources/views/layouts/guest.blade.php +++ b/resources/views/layouts/guest.blade.php @@ -16,6 +16,7 @@ + diff --git a/resources/views/livewire/banner/mempool-weather.blade.php b/resources/views/livewire/banner/mempool-weather.blade.php index 1bc07b91..d047ed1e 100644 --- a/resources/views/livewire/banner/mempool-weather.blade.php +++ b/resources/views/livewire/banner/mempool-weather.blade.php @@ -14,35 +14,72 @@
{{ $weather }} (um {{ \App\Support\Carbon::parse($changed)->asTime() }} Uhr aktualisiert - stündlich)
-
-
- + +