© 2026 Hedgehog Software, LLC
public function items() { return $this->hasMany(OrderItem::class); } Forms\Components\Placeholder::make('total') ->content(fn ($record) => $record->items->sum(\DB::raw('quantity * price')))
public function getTotalAttribute() { return $this->quantity * $this->price; } Forms\Components\Placeholder::make('total') ->content(fn ($record) => $record->items->total)