<?php

namespace App\Http\Resources\ECom;


use App\Models\Coins;
use App\Models\Customers;
use App\Models\Employess;
use App\Models\GeneralDaily;
use App\Models\ReciptVoucherDetails;
use App\Models\ReturnSales;
use Illuminate\Http\Resources\Json\JsonResource;
use DB;
use Auth;
use DateTime;

class ArticlesDetailsResources extends JsonResource
{


    public function toArray($request)
    {


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

        if($lang == 'ar'){




            $data=[

                'image'=>URL::to($this->Image),
                'date'=>$this->Date,
                'title'=>$this->Arabic_Title,
                'desc'=>strip_tags($this->Arabic_Desc),
            ];




        }else{



            $data=[
                'image'=>URL::to($this->Image),
                'date'=>$this->Date,
                'title'=>$this->English_Title,
                'desc'=>strip_tags($this->English_Desc),
            ];




        }


        return $data ;
    }

}
