<?php

namespace App\Http\Resources\Reports\CRM;


use App\Models\CommentsClients;
use App\Models\Customers;
use App\Models\Sales;
use Illuminate\Http\Resources\Json\JsonResource;
use DB;
use Auth;
use DateTime;
class CustomerPeriodReportsApiResources extends JsonResource
{


    public function toArray($request)
    {


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

        $Count=Customers::whereBetween('Date',[request('From'),request('To')])->where('Governrate',$this->id)->count();



        $data=[

            'governrate_name'=>$this->Arabic_Name
            ,'count'=>$Count

        ];




        return $data ;
    }

}
