<?php

namespace App\Http\Resources\Reports;


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

class UserLogApiResources extends JsonResource
{


    public function toArray($request)
    {


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

        if($lang == 'ar' ){

            $userr=$this->User()->first()->name;
            $screeen=$this->Screen;
            $typeee=$this->Type;
            $explaain=$this->Explain;
        }else{

            $userr=$this->User()->first()->nameEn;
            $screeen=$this->ScreenEn;
            $typeee=$this->TypeEn;
            $explaain=$this->ExplainEn;

        }



        $data=[

            'user'=>$userr
            ,'date'=>$this->Date
            ,'time'=>$this->Time
            ,'screen'=>$screeen
            ,'type'=>$typeee
            ,'explain'=>$explaain

        ];




        return $data ;
    }

}
