fix: ensure settings are only shared in views if the settings table exists
This commit is contained in:
parent
c9998f5b4f
commit
09d70d052b
@ -7,6 +7,7 @@
|
|||||||
use App\Settings\SeoSettings;
|
use App\Settings\SeoSettings;
|
||||||
use App\Settings\SocialMediaSettings;
|
use App\Settings\SocialMediaSettings;
|
||||||
use Carbon\Carbon;
|
use Carbon\Carbon;
|
||||||
|
use Illuminate\Support\Facades\Schema;
|
||||||
use Illuminate\Support\ServiceProvider;
|
use Illuminate\Support\ServiceProvider;
|
||||||
|
|
||||||
class ViewServiceProvider extends ServiceProvider
|
class ViewServiceProvider extends ServiceProvider
|
||||||
@ -24,6 +25,7 @@ public function register(): void
|
|||||||
*/
|
*/
|
||||||
public function boot(): void
|
public function boot(): void
|
||||||
{
|
{
|
||||||
|
if (Schema::hasTable('settings')) {
|
||||||
view()->share('general', app(GeneralSettings::class));
|
view()->share('general', app(GeneralSettings::class));
|
||||||
view()->share('social', app(SocialMediaSettings::class));
|
view()->share('social', app(SocialMediaSettings::class));
|
||||||
view()->share('seo', app(SeoSettings::class));
|
view()->share('seo', app(SeoSettings::class));
|
||||||
@ -47,3 +49,4 @@ public function boot(): void
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user