<?php

namespace App\Listeners;

use App\Facades\Settings;

class AddWhatsappDealershipFields
{
    /**
     * Create the event listener.
     *
     * @return void
     */
    public function __construct()
    {
        //
    }

    /**
     * Handle the event.
     *
     * @param  object  $event
     * @return array
     */
    public function handle($event)
    {
        if (!Settings::get('dealerships-whatsapp-enabled')) {
            return [];
        }

        return [
            'whatsapp-phone-number' => [
                'type' => 'text',
                'label' => 'WhatsApp Phone Number'
            ],
        ];
    }
}
