![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/job-board.corals.io/Corals/modules/Marketplace/Transformers/ |
<?php namespace Corals\Modules\Marketplace\Transformers; use Corals\Foundation\Transformers\BaseTransformer; use Corals\Modules\Marketplace\Models\Shipping; class ShippingTransformer extends BaseTransformer { public function __construct($extras = []) { $this->resource_url = config('marketplace.models.shipping.resource_url'); parent::__construct($extras); } /** * @param Shipping $shipping * @return array * @throws \Throwable */ public function transform(Shipping $shipping) { $transformedArray = [ 'id' => $shipping->id, 'priority' => $shipping->priority, 'exclusive' => $shipping->exclusive ? '<i class="fa fa-check text-success"></i>' : '-', 'name' => $shipping->name, 'store' => $shipping->store ? $shipping->store->name : '-', 'shipping_method' => $shipping->shipping_method, 'rate' => $shipping->rate ? \Currency::format($shipping->rate, \Payments::admin_currency_code()) : '-', 'min_order_total' => $shipping->min_order_total ? \Currency::format($shipping->min_order_total, \Payments::admin_currency_code()) : '-', 'country' => $shipping->country ?? 'All Countries', 'action' => $this->actions($shipping) ]; return parent::transformResponse($transformedArray); } }