<?php

namespace App\Listeners;

use App\Facades\Settings;

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

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

        return [
            'chat-moneypenny-franchise-key' => [
                'type' => 'text',
                'label' => 'Moneypenny key',
            ],
        ];
    }
}
