wip
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
<?php
|
||||
|
||||
namespace App\Http\Controllers\Api\V1\Entrepreneur\Resources\Order;
|
||||
|
||||
use App\Models\Ecommerce\Product\Order\Shipping\OrderShipping;
|
||||
use App\Models\Ecommerce\Product\Order\Status\OrderStatus;
|
||||
use Illuminate\Http\Request;
|
||||
use Illuminate\Http\Resources\Json\JsonResource;
|
||||
|
||||
class OrderIndexResource extends JsonResource
|
||||
{
|
||||
/**
|
||||
* Transform the resource into an array.
|
||||
*
|
||||
* @return array<string, mixed>
|
||||
*/
|
||||
public function toArray(Request $request): array
|
||||
{
|
||||
return [
|
||||
'id' => $this->id,
|
||||
'status' => OrderStatus::formattedStatusFor($this->status),
|
||||
'shipping_method' => OrderShipping::formattedShippingMethod($this->shipping_method),
|
||||
'notes' => $this->notes,
|
||||
'delivery_time' => $this->delivery_time,
|
||||
'delivery_at' => $this->delivery_at,
|
||||
'region' => $this->region,
|
||||
'payment_type' => $this->paymentType?->name,
|
||||
];
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user