Skip to content

Commit

Permalink
Add ChartController
Browse files Browse the repository at this point in the history
  • Loading branch information
mvdnbrk committed Dec 26, 2024
1 parent c0fae2f commit bda373a
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions app/Http/Controllers/Api/ChartController.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
<?php

namespace App\Http\Controllers\Api;

use App\Http\Controllers\Controller;
use App\Http\Resources\FloorPricesCollection;
use App\Models\FloorPrice;

class ChartController extends Controller
{
public function pizza_pets(): FloorPricesCollection
{
return new FloorPricesCollection(
FloorPrice::where('symbol', 'pizza-pets')
->take(1000)
->latest()
->get()
->reverse()
);
}

public function pizza_ninjas(): FloorPricesCollection
{
return new FloorPricesCollection(
FloorPrice::where('symbol', 'pizza-ninjas')
->take(1000)
->latest()
->get()
->reverse()
);
}
}

0 comments on commit bda373a

Please sign in to comment.