I figured it out almost immediately after writing this :'-)
$items = OrderedItem::select([
'*',
DB::raw('ROUND(quantity * item_price, 2) AS item_total')
])
->whereBetween('time_ordered', [$this->startDate, $this->endDate])
->get();
return $items->sum('item_total');
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community