In which context do you need to retrieve the new prices every minute ?
Do you want for example to dynamically refresh the view with the new prices ?
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
i can get price data of today by this codes
$date =Carbon::today()->format('Y-m-d');
$pricelist = Sell::whereDate('created_at', '=', $date)->orderBy('id','asc')->get();
$priceHL = Sell::whereDate('created_at', '=', $date)->orderBy('price','asc')->get();
$openprice = $pricelist->first()->price;
$closeprice = $pricelist->last()->price;
$highprice = $priceHL->last()->price;
$lowprice = $priceHL->first()->price;
by this way , today open price ,close price ,high price and low price can get , but i want to get by 1 minutes, example price data inserted into database within current 1 minutes , I will fetch them as above OHLC data , How can do that.
If you want to see the difference, you need to set the $now date as immutable.
$now = CarbonImmutable::now();
$oneMinuteAgo = $now->subMinutes(1);
Please or to participate in this conversation.