Remove unused JavaScript global variables

This commit is contained in:
Pig Fang 2019-04-25 23:42:06 +08:00
parent e2c125648f
commit 6918a46ae8

View File

@ -29,14 +29,15 @@ class AppServiceProvider extends ServiceProvider
}); });
Event::listen(Events\RenderingHeader::class, function ($event) { Event::listen(Events\RenderingHeader::class, function ($event) {
// Provide some application information for javascript $blessing = [
$blessing = array_merge(Arr::except(config('app'), ['key', 'providers', 'aliases', 'cipher', 'log', 'url']), [ 'version' => config('app.version'),
'locale' => config('app.locale'),
'fallback_locale' => config('app.fallback_locale'),
'base_url' => url('/'), 'base_url' => url('/'),
'site_name' => option_localized('site_name'), 'site_name' => option_localized('site_name'),
'route' => request()->path(), 'route' => request()->path(),
'extra' => [], 'extra' => [],
]); ];
$event->addContent('<script>var blessing = '.json_encode($blessing).';</script>'); $event->addContent('<script>var blessing = '.json_encode($blessing).';</script>');
}); });