mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-13 09:40:18 +01:00
33 lines
740 B
PHP
33 lines
740 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Exception;
|
|
use Illuminate\Support\ServiceProvider;
|
|
use Nette\Utils\Json;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
* @throws Exception
|
|
*/
|
|
public function boot(Controller $controller): void
|
|
{
|
|
cache()->rememberForever(
|
|
'translations_' . app()->getLocale(),
|
|
static fn() => Json::decode(file_get_contents(resource_path('lang/' . app()->getLocale() . '.json')))
|
|
);
|
|
|
|
view()->share('modules', $controller->getModules(request()));
|
|
}
|
|
}
|