| 123456789101112131415161718192021222324252627282930313233 |
- <?php
-
- namespace App\Models;
-
- use Illuminate\Database\Eloquent\Attributes\Fillable;
- use Illuminate\Database\Eloquent\Model;
- use Illuminate\Database\Eloquent\Relations\BelongsTo;
-
- /**
- * One line of an order: a product, its price at the time, and how many.
- *
- * @property int $id
- * @property int $store_id
- * @property int $order_id
- * @property int|null $product_id
- * @property int|null $variant_id
- * @property string|null $variant_name
- * @property string $name
- * @property int $unit_price
- * @property int $quantity
- * @property int $line_total
- */
- #[Fillable(['store_id', 'product_id', 'variant_id', 'name', 'variant_name', 'unit_price', 'quantity', 'line_total'])]
- class OrderItem extends Model
- {
- /**
- * @return BelongsTo<Order, $this>
- */
- public function order(): BelongsTo
- {
- return $this->belongsTo(Order::class);
- }
- }
|