Skip to content

Commit 226b796

Browse files
committed
wip
1 parent e94679e commit 226b796

File tree

1 file changed

+11
-3
lines changed

1 file changed

+11
-3
lines changed

app/Providers/AppServiceProvider.php

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,11 @@
66
use App\Checks\FailedJobsCheck;
77
use App\Checks\FilesystemsDefaultCheck;
88
use App\Checks\JobsCheck;
9+
use App\Models\Configuration;
910
use App\Models\News;
1011
use App\Models\Product;
1112
use App\Models\Service;
1213
use Illuminate\Database\Eloquent\Model;
13-
use Illuminate\Support\Facades\Schema;
1414
use Illuminate\Support\Facades\View;
1515
use Illuminate\Support\ServiceProvider;
1616
use Spatie\Health\Checks\Checks\CacheCheck;
@@ -45,8 +45,7 @@ public function boot(): void
4545
SecurityAdvisoriesCheck::new()->lastDayOfMonth(),
4646
]);
4747

48-
View::share('configuration', Schema::hasTable('configurations') ? (new ViewDataAction)->configuration(app()->getLocale()) : null);
49-
48+
View::share('configuration', $this->getConfiguration());
5049
}
5150

5251
private function multilanguage(): void
@@ -55,4 +54,13 @@ private function multilanguage(): void
5554
Service::registerLocalizedBinding('service');
5655
Product::registerLocalizedBinding('product');
5756
}
57+
58+
private function getConfiguration(): ?Configuration
59+
{
60+
try {
61+
return (new ViewDataAction)->configuration(app()->getLocale());
62+
} catch (\Throwable) {
63+
return null;
64+
}
65+
}
5866
}

0 commit comments

Comments
 (0)