improve app setup

This commit is contained in:
Olivier Legat 2021-07-01 17:26:18 +02:00
parent fda6899202
commit 74dc46c1e5

View file

@ -57,11 +57,15 @@ class AppServiceProvider extends ServiceProvider
}
View::share('published_tags', $tags);
//this is useful when setting up the app whene settings table doesn't exist yet
try {
$front_settings = Setting::where('key', 'LIKE', 'theme_%')->get();
} catch (QueryException $e) {
$front_settings = null;
}
//front theme settings
$front_settings = Setting::where('key', 'LIKE', 'theme_%')->get();
View::share('front_settings', $front_settings);
Blade::directive('fmt_currency', function ($expression) {
return "<?php echo sprintf('%s € TTC', number_format($expression, 2, ',', ' ')); ?>";
});