Edit File: CountriesResource.php
<?php namespace App\Http\Resources; use Illuminate\Http\Resources\Json\JsonResource; class CountriesResource extends JsonResource { /** * Transform the resource into an array. * * @param \Illuminate\Http\Request $request * @return array */ public function toArray($request) { return [ 'id' => $this->id, 'name' => $this->name??'', 'currency' => $this->currency??'', 'currency_code' => $this->currency_code??'', 'currency_code_ar' => $this->getTranslations('currency_code')['ar']??'', 'currency_code_en' => $this->getTranslations('currency_code')['en']??'', 'example' => $this->example??'', 'iso2' => $this->iso2??'', 'iso3' => $this->iso3??'', 'calling_code' => $this->calling_code??'', 'flag' => $this->flag?$this->flagPath:'', ]; } }
Back to File Manager