1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-03-13 17:50:05 +01:00
openstamanager/app/Providers/AppServiceProvider.php

33 lines
740 B
PHP
Raw Normal View History

2021-07-30 19:26:02 +02:00
<?php
namespace App\Providers;
use App\Http\Controllers\Controller;
use Exception;
2021-07-30 19:26:02 +02:00
use Illuminate\Support\ServiceProvider;
use Nette\Utils\Json;
2021-07-30 19:26:02 +02:00
class AppServiceProvider extends ServiceProvider
{
/**
* Register any application services.
*/
public function register(): void
2021-07-30 19:26:02 +02:00
{
}
/**
* Bootstrap any application services.
* @throws Exception
2021-07-30 19:26:02 +02:00
*/
public function boot(Controller $controller): void
2021-07-30 19:26:02 +02:00
{
cache()->rememberForever(
'translations_' . app()->getLocale(),
static fn() => Json::decode(file_get_contents(resource_path('lang/' . app()->getLocale() . '.json')))
);
view()->share('modules', $controller->getModules(request()));
2021-07-30 19:26:02 +02:00
}
}