<?php

namespace App\Http\Resources;

use App\Facades\Settings;
use Illuminate\Http\Request;

class EnquiryTypeResource extends \Mtc\Crm\Http\Resources\EnquiryTypeResource
{
    #[\Override]
    public function toArray(Request $request): array
    {
        $resource = $this->resource->toArray();
        $resource['salesforce_crm_enabled'] = Settings::get('salesforce-crm-enabled');
        $resource['salesforce_form_type'] = $resource['data']['salesforce_form_type'] ?? null;
        $resource['webleads_crm_enabled'] = Settings::get('crm-webleads-enabled');
        $resource['webleads_form_type'] = $resource['data']['webleads_form_type'] ?? null;
        return $resource;
    }
}
