2020-11-18 10:23:51 +01:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
|
2022-04-26 12:15:31 +02:00
|
|
|
use App\Models\MacroSchedule\Marker;
|
2021-04-15 16:47:57 +02:00
|
|
|
use Illuminate\Pagination\Paginator;
|
2022-04-26 12:15:31 +02:00
|
|
|
use Illuminate\Support\Facades\Cache;
|
2021-07-30 00:33:18 +02:00
|
|
|
use Illuminate\Support\Facades\File;
|
2021-06-18 15:39:19 +02:00
|
|
|
use Illuminate\Support\Facades\URL;
|
2021-05-21 16:02:29 +02:00
|
|
|
use Illuminate\Support\Facades\View;
|
2020-11-18 10:23:51 +01:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Register any application services.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function register()
|
|
|
|
|
{
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Bootstrap any application services.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function boot()
|
|
|
|
|
{
|
2021-04-15 16:47:57 +02:00
|
|
|
Paginator::useBootstrap();
|
2022-06-09 12:03:49 +02:00
|
|
|
|
|
|
|
|
URL::forceScheme('https');
|
2021-05-21 16:02:29 +02:00
|
|
|
|
2021-12-04 18:53:39 +01:00
|
|
|
if (config('app.env') === 'local') {
|
|
|
|
|
setlocale(LC_TIME, strtoupper(config('app.locale')) . "_" . config('app.locale') . '.utf8');
|
|
|
|
|
}
|
|
|
|
|
|
2021-07-30 00:33:18 +02:00
|
|
|
|
2022-04-26 12:15:31 +02:00
|
|
|
|
|
|
|
|
if (!app()->runningInConsole()) {
|
|
|
|
|
$appInfos = Cache::remember('composer', 360, function () {
|
|
|
|
|
return json_decode(File::get(\app_path('../composer.json')));
|
|
|
|
|
});
|
|
|
|
|
View::share('name', $appInfos->name);
|
|
|
|
|
View::share('version', $appInfos->version);
|
|
|
|
|
View::share('license', $appInfos->license);
|
|
|
|
|
|
|
|
|
|
// * Groups
|
|
|
|
|
View::share('markerLabels', Cache::rememberForever('markerLabels', function () {
|
|
|
|
|
return Marker::getCachedLabels() ?? [];
|
|
|
|
|
}));
|
|
|
|
|
}//end if
|
2020-11-18 10:23:51 +01:00
|
|
|
}
|
|
|
|
|
}
|