From bda373a0da6dee0acb31179a0940366f19f200c6 Mon Sep 17 00:00:00 2001 From: Mark van den Broek Date: Thu, 26 Dec 2024 23:32:50 +0100 Subject: [PATCH] Add ChartController --- app/Http/Controllers/Api/ChartController.php | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 app/Http/Controllers/Api/ChartController.php diff --git a/app/Http/Controllers/Api/ChartController.php b/app/Http/Controllers/Api/ChartController.php new file mode 100644 index 0000000..0934cd9 --- /dev/null +++ b/app/Http/Controllers/Api/ChartController.php @@ -0,0 +1,32 @@ +take(1000) + ->latest() + ->get() + ->reverse() + ); + } + + public function pizza_ninjas(): FloorPricesCollection + { + return new FloorPricesCollection( + FloorPrice::where('symbol', 'pizza-ninjas') + ->take(1000) + ->latest() + ->get() + ->reverse() + ); + } +}