Fix for Hide/Show Client Portal Dashboard

This commit is contained in:
David Bomba 2021-01-13 18:43:26 +11:00
parent 75081cf95a
commit ccf65f1c7c

View File

@ -21,6 +21,8 @@ use Illuminate\View\View;
*/ */
class PortalComposer class PortalComposer
{ {
public $settings;
/** /**
* Bind data to the view. * Bind data to the view.
* *
@ -45,13 +47,15 @@ class PortalComposer
return []; return [];
} }
$this->settings = auth()->user()->client->getMergedSettings();
$data['sidebar'] = $this->sidebarMenu(); $data['sidebar'] = $this->sidebarMenu();
$data['header'] = []; $data['header'] = [];
$data['footer'] = []; $data['footer'] = [];
$data['countries'] = TranslationHelper::getCountries(); $data['countries'] = TranslationHelper::getCountries();
$data['company'] = auth()->user()->company; $data['company'] = auth()->user()->company;
$data['client'] = auth()->user()->client; $data['client'] = auth()->user()->client;
$data['settings'] = auth()->user()->client->getMergedSettings(); $data['settings'] = $this->settings;
$data['currencies'] = TranslationHelper::getCurrencies(); $data['currencies'] = TranslationHelper::getCurrencies();
$data['multiple_contacts'] = session()->get('multiple_contacts'); $data['multiple_contacts'] = session()->get('multiple_contacts');
@ -63,7 +67,9 @@ class PortalComposer
{ {
$data = []; $data = [];
// $data[] = [ 'title' => ctrans('texts.dashboard'), 'url' => 'client.dashboard', 'icon' => 'activity']; if($this->settings->enable_client_portal_dashboard == TRUE)
$data[] = [ 'title' => ctrans('texts.dashboard'), 'url' => 'client.dashboard', 'icon' => 'activity'];
$data[] = ['title' => ctrans('texts.invoices'), 'url' => 'client.invoices.index', 'icon' => 'file-text']; $data[] = ['title' => ctrans('texts.invoices'), 'url' => 'client.invoices.index', 'icon' => 'file-text'];
$data[] = ['title' => ctrans('texts.recurring_invoices'), 'url' => 'client.recurring_invoices.index', 'icon' => 'file']; $data[] = ['title' => ctrans('texts.recurring_invoices'), 'url' => 'client.recurring_invoices.index', 'icon' => 'file'];
$data[] = ['title' => ctrans('texts.payments'), 'url' => 'client.payments.index', 'icon' => 'credit-card']; $data[] = ['title' => ctrans('texts.payments'), 'url' => 'client.payments.index', 'icon' => 'credit-card'];