<?php

namespace App\Http\Resources;


use Illuminate\Http\Resources\Json\JsonResource;
use DB;
use Auth;

class NameResources extends JsonResource
{
    public function toArray($request)
    {

        $lang = $request->header('lang', '');


        if($lang ==  'ar') {
            $data = [


                'id'=>$this->id,
                'name'=>$this->Name


            ];
        }else{


            $data = [


                'id'=>$this->id,
                'name'=>$this->NameEn


            ];
        }



        return $data ;
    }

}
