<?php

namespace App\Http\Resources;

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

class EnquiryTypeResource extends \Mtc\Crm\Http\Resources\EnquiryTypeResource
{
    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;
        return $resource;
    }
}
