<?php

namespace App\Http\Resources;

use App\Http\Resources\UserResource as UserResource;
use App\Http\Resources\ModelResource;
use Illuminate\Http\Resources\Json\JsonResource;
use App\Setting;
use Illuminate\Http\Request;

class SettingResource extends JsonResource
{
    /**
     * Transform the resource into an array.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return array
     */
    public function toArray($request)
    {
        
        
        $email = Setting::where('key','email')->first();
        $phone = Setting::where('key','phone')->first();
        $address = Setting::where('key','address')->first();
        // $tax = Setting::where('key','tax')->first();
        // $youtube = Setting::where('key','youtube')->first();
        // $twitter = Setting::where('key','twitter')->first();
        // $facebook = Setting::where('key','facebook')->first();
        // $start = Setting::where('key','start')->first();
        // $end = Setting::where('key','end')->first();
        // $day = Setting::where('key','day')->first();
        
        
        
        
       
        $data =  [
            'email' => $email['value'],
            'phone' => $phone['value'],
            'address' => $address['value'],
            // 'tax' => $tax['value'],
            // 'youtube' => $youtube['value'],
            // 'twitter' => $twitter['value'],
            // 'facebook' => $facebook['value'],
            // 'start' => $start['value'],
            // 'end' => $end['value'],
            // 'day' => $day['value'],
            
            
            
            
            
      ];
     
         
      
      return $data;
    }
}
