From fbf0afb9e64a1ca927bdfef53a3c6a75f079b06a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ruan=20P=C3=A9pe?= Date: Tue, 11 Aug 2026 12:32:22 -0300 Subject: [PATCH 1/2] Refactor logo display logic in auth-master view The `auth_logo` configuration option has not been implemented. This code was copied from v3. Ref.: https://github.com/jeroennoten/Laravel-AdminLTE/blob/master/resources/views/auth/auth-page.blade.php --- resources/views/auth/auth-master.blade.php | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/resources/views/auth/auth-master.blade.php b/resources/views/auth/auth-master.blade.php index 6726887..a6c1e0b 100644 --- a/resources/views/auth/auth-master.blade.php +++ b/resources/views/auth/auth-master.blade.php @@ -19,6 +19,22 @@
From 0d82ec9f64bf6f0cff9fb399527a20f319e34007 Mon Sep 17 00:00:00 2001 From: Aigars Silkalns Date: Thu, 13 Aug 2026 10:30:44 +0300 Subject: [PATCH 2/2] fix(auth): gate the auth logo on auth_logo.enabled MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The `@else` branch rendered `logo_img` whenever `auth_logo.enabled` was false — which is its default — so wiring the config up also put an image on every auth page for every consumer. Two problems with that: * `auth_logo.enabled` stopped being a toggle and became a picker for *which* logo to show. There was no longer any way to get the plain text logo the auth pages have always shown. * `adminlte:install` publishes no images at all (neither INSTALL_ASSETS nor PACKAGE_VENDOR_FILES has a single png/jpg), so the `logo_img` default points at a path a fresh install does not have. The result was a broken-image icon on login, register, forgot-password, reset, verify-email and confirm-password. Drop the `@else` so `enabled => false` means what it says. Also drop the redundant `, null` fallbacks — `config()` already returns null on a miss. Adds AuthLogoTest covering the default-off path, the enabled path, custom img overrides, and omission of empty optional attributes. Co-Authored-By: Claude Opus 5 (1M context) --- CHANGELOG.md | 8 ++ resources/views/auth/auth-master.blade.php | 15 ++-- tests/AuthLogoTest.php | 90 ++++++++++++++++++++++ 3 files changed, 104 insertions(+), 9 deletions(-) create mode 100644 tests/AuthLogoTest.php diff --git a/CHANGELOG.md b/CHANGELOG.md index 2c41036..f064e81 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed + +- **`auth_logo` is wired up.** The config block has shipped since 1.0 but no + view ever read it, so enabling it did nothing. The auth pages now render the + configured image — honouring `class`, `width` and `height`, and omitting each + attribute when its config value is empty — above the text `logo`. With + `auth_logo.enabled` left at its `false` default the auth pages are unchanged. + ## [1.2.0] - 2026-08-11 ### Added diff --git a/resources/views/auth/auth-master.blade.php b/resources/views/auth/auth-master.blade.php index a6c1e0b..f7875c7 100644 --- a/resources/views/auth/auth-master.blade.php +++ b/resources/views/auth/auth-master.blade.php @@ -22,18 +22,15 @@ @if (config('adminlte.auth_logo.enabled', false)) {{ config('adminlte.auth_logo.img.alt') }} - @else - {{ config('adminlte.logo_img_alt') }} @endif {!! config('adminlte.logo', 'AdminLTE') !!} diff --git a/tests/AuthLogoTest.php b/tests/AuthLogoTest.php new file mode 100644 index 0000000..3718ea7 --- /dev/null +++ b/tests/AuthLogoTest.php @@ -0,0 +1,90 @@ +withoutVite(); + + // auth-master's children link to the named login route. + Route::get('login', fn () => '')->name('login'); + } + + private function renderLogin(): string + { + return view('adminlte::auth.login')->withErrors([])->render(); + } + + public function test_auth_logo_is_absent_by_default(): void + { + // `auth_logo.enabled` ships false — the auth pages show the text logo + // only. Nothing may reference the image path, which no install step + // publishes. + $html = $this->renderLogin(); + + $this->assertStringNotContainsString('AdminLTELogo.png', $html); + $this->assertStringContainsString('AdminLTE', $html); + } + + public function test_auth_logo_renders_when_enabled(): void + { + config()->set('adminlte.auth_logo.enabled', true); + + $html = $this->renderLogin(); + + $this->assertStringContainsString(asset('vendor/adminlte/img/AdminLTELogo.png'), $html); + $this->assertStringContainsString('alt="Auth Logo"', $html); + $this->assertStringContainsString('width="50"', $html); + $this->assertStringContainsString('height="50"', $html); + } + + public function test_auth_logo_honours_img_overrides(): void + { + config()->set('adminlte.auth_logo', [ + 'enabled' => true, + 'img' => [ + 'path' => 'img/brand.svg', + 'alt' => 'Acme', + 'class' => 'rounded me-2', + 'width' => 120, + 'height' => 40, + ], + ]); + + $html = $this->renderLogin(); + + $this->assertStringContainsString(asset('img/brand.svg'), $html); + $this->assertStringContainsString('alt="Acme"', $html); + $this->assertStringContainsString('class="rounded me-2"', $html); + $this->assertStringContainsString('width="120"', $html); + $this->assertStringContainsString('height="40"', $html); + } + + public function test_optional_img_attributes_are_omitted_when_empty(): void + { + config()->set('adminlte.auth_logo', [ + 'enabled' => true, + 'img' => [ + 'path' => 'img/brand.svg', + 'alt' => 'Acme', + 'class' => '', + 'width' => null, + 'height' => null, + ], + ]); + + $html = $this->renderLogin(); + + // Note: the quoted forms only — the viewport meta carries an unquoted + // `width=device-width`. + $this->assertStringNotContainsString('width="', $html); + $this->assertStringNotContainsString('height="', $html); + $this->assertStringNotContainsString('class=""', $html); + } +}