Merge branch 'develop' into trunk
This commit is contained in:
commit
d48c9aa99b
1 changed files with 28 additions and 20 deletions
|
|
@ -9,6 +9,7 @@ use Illuminate\Support\Facades\View;
|
|||
use Illuminate\Support\ServiceProvider;
|
||||
use Illuminate\Support\Facades\Blade;
|
||||
use Illuminate\Pagination\Paginator;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
use Illuminate\Support\Facades\URL;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
|
|
@ -38,29 +39,36 @@ class AppServiceProvider extends ServiceProvider
|
|||
setlocale(LC_TIME, strtoupper(config('app.locale')) . "_" . config('app.locale') . '.utf8');
|
||||
}
|
||||
|
||||
config([
|
||||
'bosettings' => Setting::all()
|
||||
->keyBy('key')
|
||||
// Key every setting by its name.
|
||||
->transform(function ($setting) {
|
||||
return $setting->value;
|
||||
// Return only the value.
|
||||
})
|
||||
->toArray()
|
||||
// Make it an array.
|
||||
]);
|
||||
if (Schema::hasTable('settings')) {
|
||||
// The "settings" table exists...
|
||||
config([
|
||||
'bosettings' => Setting::all()
|
||||
->keyBy('key')
|
||||
// Key every setting by its name.
|
||||
->transform(function ($setting) {
|
||||
return $setting->value;
|
||||
// Return only the value.
|
||||
})
|
||||
->toArray()
|
||||
// Make it an array.
|
||||
]);
|
||||
|
||||
// On partage les ranges (gammes produit).
|
||||
$ranges = Range::where('status', '1')->get();
|
||||
View::share('published_ranges', $ranges);
|
||||
$front_settings = Setting::where('key', 'LIKE', 'theme_%')->get();
|
||||
// Front theme settings.
|
||||
View::share('front_settings', $front_settings);
|
||||
}
|
||||
|
||||
// On partage les tags.
|
||||
$tags = Tag::where('status', '1')->orderBy('order', 'ASC')->get();
|
||||
View::share('published_tags', $tags);
|
||||
if (Schema::hasTable('ranges')) {
|
||||
// On partage les ranges (gammes produit).
|
||||
$ranges = Range::where('status', '1')->get();
|
||||
View::share('published_ranges', $ranges);
|
||||
}
|
||||
|
||||
$front_settings = Setting::where('key', 'LIKE', 'theme_%')->get();
|
||||
// Front theme settings.
|
||||
View::share('front_settings', $front_settings);
|
||||
if (Schema::hasTable('tags')) {
|
||||
// On partage les tags.
|
||||
$tags = Tag::where('status', '1')->orderBy('order', 'ASC')->get();
|
||||
View::share('published_tags', $tags);
|
||||
}
|
||||
|
||||
Blade::directive('fmt_currency', function ($expression) {
|
||||
return "<?php
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue