improved tenant identification

This commit is contained in:
Denis Duliçi
2021-04-16 00:59:43 +03:00
parent 9635e6be5d
commit 2b07442260
126 changed files with 1719 additions and 999 deletions

View File

@ -9,7 +9,6 @@ use Illuminate\View\View;
class DocumentType
{
/**
* Bind data to the view.
*
@ -18,14 +17,15 @@ class DocumentType
*/
public function compose(View $view)
{
if (!empty(request()->route())) {
$route = request()->route();
$route = request()->route();
/** @var Invoices|Bills|PortalInvoices $controller */
$controller = $route->getController();
$view->with(['type' => $controller->type ?? '']);
if (empty($route)) {
return;
}
}
/** @var Invoices|Bills|PortalInvoices $controller */
$controller = $route->getController();
$view->with(['type' => $controller->type ?? '']);
}
}

View File

@ -6,7 +6,6 @@ use Illuminate\View\View;
class InvoiceText
{
/**
* Bind data to the view.
*
@ -41,5 +40,4 @@ class InvoiceText
$view->with(['text_override' => $text_override]);
}
}
}

View File

@ -42,7 +42,7 @@ class Logo
$image->make($path)->resize($width, $height)->encode();
});
} catch (NotReadableException | \Exception $e) {
Log::info('Company ID: ' . session('company_id') . ' viewcomposer/logo.php exception.');
Log::info('Company ID: ' . company_id() . ' viewcomposer/logo.php exception.');
Log::info($e->getMessage());
$path = base_path('public/img/company.png');

View File

@ -27,6 +27,8 @@ class Notifications
return;
}
$path = str_replace('{company_id}/', '', $path);
if (!$notifications = $this->getNotifications($path)) {
return;
}

View File

@ -31,6 +31,8 @@ class Suggestions
return;
}
$path = str_replace('{company_id}/', '', $path);
if (!$suggestions = $this->getSuggestions($path)) {
return;
}