![]() 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/rentpix.corals.io/Corals/modules/RentPix/Transformers/API/ |
<?php namespace Corals\Modules\RentPix\Transformers\API; use Corals\Foundation\Transformers\APIBaseTransformer; use Corals\Modules\RentPix\Models\Unit; class UnitTransformer extends APIBaseTransformer { /** * @param Unit $unit * @return array * * @throws \Throwable */ public function transform(Unit $unit) { $transformedArray = [ 'code' => $unit->code, 'vin' => $unit->vin, 'license' => $unit->license, 'engin' => $unit->engine, 'make' => $unit->make, 'model' => $unit->model, 'model_year' => $unit->model_year, 'rate_code' => optional($unit->rateCode)->title, 'status' => $unit->status, ]; return parent::transformResponse($transformedArray); } }