File tree Expand file tree Collapse file tree 1 file changed +11
-3
lines changed
Expand file tree Collapse file tree 1 file changed +11
-3
lines changed Original file line number Diff line number Diff line change 66use App \Checks \FailedJobsCheck ;
77use App \Checks \FilesystemsDefaultCheck ;
88use App \Checks \JobsCheck ;
9+ use App \Models \Configuration ;
910use App \Models \News ;
1011use App \Models \Product ;
1112use App \Models \Service ;
1213use Illuminate \Database \Eloquent \Model ;
13- use Illuminate \Support \Facades \Schema ;
1414use Illuminate \Support \Facades \View ;
1515use Illuminate \Support \ServiceProvider ;
1616use 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}
You can’t perform that action at this time.
0 commit comments