1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00
invoiceninja/app/Utils/Helpers.php
Benjamin Beganović 69b24f95c4 Centralised variables:
- New Helpers.php with sharedEmailVariables
- Merged settings from TemplateEngine
- @isset check for $whitelabel in the master.blade
2020-09-28 12:36:51 +02:00

30 lines
741 B
PHP

<?php
/**
* Invoice Ninja (https://invoiceninja.com).
*
* @link https://github.com/invoiceninja/invoiceninja source repository
*
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
*
* @license https://opensource.org/licenses/AAL
*/
namespace App\Utils;
use App\Models\Client;
class Helpers
{
public static function sharedEmailVariables(Client $client, array $settings = null): array
{
$_settings = is_null($settings) ? $client->getMergedSettings() : $settings;
$elements['signature'] = $_settings->email_signature;
$elements['settings'] = $_settings;
$elements['whitelabel'] = $client->user->account->isPaid() ? true : false;
return $elements;
}
}