- @if (Statamic::pro() && config('statamic.cp.custom_logo_url'))
-
+ @if ($customLogo)
+
@else
@cp_svg('statamic-wordmark')
@if (Statamic::pro())
PRO@endif
diff --git a/resources/views/partials/outside-logo.blade.php b/resources/views/partials/outside-logo.blade.php
index 8714056715..bdbb92cc7e 100644
--- a/resources/views/partials/outside-logo.blade.php
+++ b/resources/views/partials/outside-logo.blade.php
@@ -1,6 +1,6 @@
- @if (Statamic::pro() && config('statamic.cp.custom_logo_url'))
-
+ @if ($customLogo)
+
@else
@cp_svg('statamic-wordmark')
@endif
diff --git a/src/Http/View/Composers/CustomLogoComposer.php b/src/Http/View/Composers/CustomLogoComposer.php
new file mode 100644
index 0000000000..01caede8c0
--- /dev/null
+++ b/src/Http/View/Composers/CustomLogoComposer.php
@@ -0,0 +1,50 @@
+with('customLogo', $this->customLogo($view));
+ }
+
+ protected function customLogo($view)
+ {
+ if (! Statamic::pro()) {
+ return false;
+ }
+
+ $config = config('statamic.cp.custom_logo_url');
+
+ switch ($view->name()) {
+ case 'statamic::partials.outside-logo':
+ $type = 'outside';
+ break;
+ case 'statamic::partials.global-header':
+ $type = 'nav';
+ break;
+ default:
+ $type = 'other';
+ }
+
+ if ($logo = Arr::get($config, $type)) {
+ return $logo;
+ }
+
+ if (! is_array($config)) {
+ return $config;
+ }
+
+ return false;
+ }
+}
diff --git a/src/Providers/CpServiceProvider.php b/src/Providers/CpServiceProvider.php
index e831ed3db7..d1b710c575 100644
--- a/src/Providers/CpServiceProvider.php
+++ b/src/Providers/CpServiceProvider.php
@@ -11,6 +11,7 @@
use Statamic\Extensions\Translation\Loader;
use Statamic\Extensions\Translation\Translator;
use Statamic\Facades\User;
+use Statamic\Http\View\Composers\CustomLogoComposer;
use Statamic\Http\View\Composers\FieldComposer;
use Statamic\Http\View\Composers\JavascriptComposer;
use Statamic\Http\View\Composers\NavComposer;
@@ -30,6 +31,7 @@ public function boot()
View::composer(SessionExpiryComposer::VIEWS, SessionExpiryComposer::class);
View::composer(JavascriptComposer::VIEWS, JavascriptComposer::class);
View::composer(NavComposer::VIEWS, NavComposer::class);
+ View::composer(CustomLogoComposer::VIEWS, CustomLogoComposer::class);
CoreUtilities::boot();