diff --git a/app/Console/Commands/DemoMode.php b/app/Console/Commands/DemoMode.php index 74b559355b26..847166eab500 100644 --- a/app/Console/Commands/DemoMode.php +++ b/app/Console/Commands/DemoMode.php @@ -18,8 +18,10 @@ use App\Factory\InvoiceItemFactory; use App\Helpers\Invoice\InvoiceSum; use App\Jobs\Ninja\CompanySizeCheck; use App\Jobs\Util\VersionCheck; +use App\Models\Account; use App\Models\Client; use App\Models\ClientContact; +use App\Models\Company; use App\Models\CompanyToken; use App\Models\Country; use App\Models\Credit; diff --git a/app/Utils/Helpers.php b/app/Utils/Helpers.php index ef28f19440dc..38bc2feacc9b 100644 --- a/app/Utils/Helpers.php +++ b/app/Utils/Helpers.php @@ -16,8 +16,18 @@ use App\Models\Client; class Helpers { - public static function sharedEmailVariables(Client $client, array $settings = null): array + public static function sharedEmailVariables(?Client $client, array $settings = null): array { + if(!$client){ + + $elements['signature'] = ''; + $elements['settings'] = new \stdClass; + $elements['whitelabel'] = true; + + return $elements; + + } + $_settings = is_null($settings) ? $client->getMergedSettings() : $settings; $elements['signature'] = $_settings->email_signature;