From e9d2d7d7f27ab5660d964e12c9cfd93e4c5dba53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Benjamin=20Beganovi=C4=87?= Date: Thu, 1 Jul 2021 18:29:32 +0200 Subject: [PATCH] Show logo on the login screen if account whitelabel or official subdomain --- app/Http/Controllers/Auth/ContactLoginController.php | 5 +++-- resources/views/portal/ninja2020/auth/login.blade.php | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/Auth/ContactLoginController.php b/app/Http/Controllers/Auth/ContactLoginController.php index 7bd8b227cfdb..f741954fbdfa 100644 --- a/app/Http/Controllers/Auth/ContactLoginController.php +++ b/app/Http/Controllers/Auth/ContactLoginController.php @@ -35,8 +35,9 @@ class ContactLoginController extends Controller public function showLoginForm(Request $request) { - if ($request->subdomain) { - $company = Company::where('subdomain', $request->subdomain)->first(); + if (strpos($request->getHost(), 'invoicing.co') !== false) { + $subdomain = explode('.', $request->getHost())[0]; + $company = Company::where('subdomain', $subdomain)->first(); } elseif (Ninja::isSelfHost()) { $company = Account::first()->default_company; } else { diff --git a/resources/views/portal/ninja2020/auth/login.blade.php b/resources/views/portal/ninja2020/auth/login.blade.php index 72329438934a..4d9a89b46d77 100644 --- a/resources/views/portal/ninja2020/auth/login.blade.php +++ b/resources/views/portal/ninja2020/auth/login.blade.php @@ -15,14 +15,19 @@ alt="Background image"> @endif +
- @if($account && !$account->isPaid())
Invoice Ninja logo
+ @elseif(isset($company) && !is_null($company)) +
+ {{ $company->present()->name() }} logo +
@endif