AI store generator for ecommerce, Malaysia first. Laravel 13 + React + TypeScript.
Nevar pievienot vairāk kā 25 tēmas Tēmai ir jāsākas ar burtu vai ciparu, tā var saturēt domu zīmes ('-') un var būt līdz 35 simboliem gara.

Quote.php 1.3KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. namespace App\Commerce\Shipping\EasyParcel;
  3. /**
  4. * One courier service EasyParcel offers for a parcel, with its price.
  5. */
  6. final readonly class Quote
  7. {
  8. public function __construct(
  9. public string $serviceId,
  10. public string $courier,
  11. public string $service,
  12. public ?string $logo,
  13. /** In sen. */
  14. public int $price,
  15. /** The courier comes to the merchant's pickup address. */
  16. public bool $pickup,
  17. /** The merchant takes the parcel to a counter. */
  18. public bool $dropoff,
  19. /** Such as "About 3 days", when EasyParcel says. */
  20. public ?string $delivery,
  21. /** Something the merchant must know, such as "Pickup needs at least 3 parcels". */
  22. public ?string $note = null,
  23. ) {}
  24. /**
  25. * @return array<string, mixed>
  26. */
  27. public function toArray(): array
  28. {
  29. return [
  30. 'service_id' => $this->serviceId,
  31. 'courier' => $this->courier,
  32. 'service' => $this->service,
  33. 'logo' => $this->logo,
  34. 'price' => $this->price / 100,
  35. 'pickup' => $this->pickup,
  36. 'dropoff' => $this->dropoff,
  37. 'delivery' => $this->delivery,
  38. 'note' => $this->note,
  39. ];
  40. }
  41. }