improved tenant identification
This commit is contained in:
@ -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 ?? '']);
|
||||
}
|
||||
}
|
||||
|
@ -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]);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -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');
|
||||
|
@ -27,6 +27,8 @@ class Notifications
|
||||
return;
|
||||
}
|
||||
|
||||
$path = str_replace('{company_id}/', '', $path);
|
||||
|
||||
if (!$notifications = $this->getNotifications($path)) {
|
||||
return;
|
||||
}
|
||||
|
@ -31,6 +31,8 @@ class Suggestions
|
||||
return;
|
||||
}
|
||||
|
||||
$path = str_replace('{company_id}/', '', $path);
|
||||
|
||||
if (!$suggestions = $this->getSuggestions($path)) {
|
||||
return;
|
||||
}
|
||||
|
Reference in New Issue
Block a user