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

OrderItem.php 758B

12345678910111213141516171819202122232425262728293031
  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 string $name
  14. * @property int $unit_price
  15. * @property int $quantity
  16. * @property int $line_total
  17. */
  18. #[Fillable(['store_id', 'product_id', 'name', 'unit_price', 'quantity', 'line_total'])]
  19. class OrderItem extends Model
  20. {
  21. /**
  22. * @return BelongsTo<Order, $this>
  23. */
  24. public function order(): BelongsTo
  25. {
  26. return $this->belongsTo(Order::class);
  27. }
  28. }