AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. namespace App\Models;
  3. use Illuminate\Database\Eloquent\Attributes\Fillable;
  4. use Illuminate\Database\Eloquent\Model;
  5. use Illuminate\Database\Eloquent\Relations\BelongsTo;
  6. /**
  7. * One line of an order: a product, its price at the time, and how many.
  8. *
  9. * @property int $id
  10. * @property int $store_id
  11. * @property int $order_id
  12. * @property int|null $product_id
  13. * @property int|null $variant_id
  14. * @property string|null $variant_name
  15. * @property string $name
  16. * @property int $unit_price
  17. * @property int $quantity
  18. * @property int $line_total
  19. */
  20. #[Fillable(['store_id', 'product_id', 'variant_id', 'name', 'variant_name', 'unit_price', 'quantity', 'line_total'])]
  21. class OrderItem extends Model
  22. {
  23. /**
  24. * @return BelongsTo<Order, $this>
  25. */
  26. public function order(): BelongsTo
  27. {
  28. return $this->belongsTo(Order::class);
  29. }
  30. }