2021-07-30 19:26:02 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Providers;
|
|
|
|
|
2021-11-09 10:34:22 +01:00
|
|
|
use Exception;
|
2021-07-30 19:26:02 +02:00
|
|
|
use Illuminate\Support\ServiceProvider;
|
2021-11-09 10:14:08 +01:00
|
|
|
use Nette\Utils\Json;
|
2021-07-30 19:26:02 +02:00
|
|
|
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Register any application services.
|
|
|
|
*/
|
2021-08-03 19:43:16 +02:00
|
|
|
public function register(): void
|
2021-07-30 19:26:02 +02:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Bootstrap any application services.
|
2021-11-09 10:34:22 +01:00
|
|
|
* @throws Exception
|
2021-07-30 19:26:02 +02:00
|
|
|
*/
|
2021-08-03 19:43:16 +02:00
|
|
|
public function boot(): void
|
2021-07-30 19:26:02 +02:00
|
|
|
{
|
2021-11-09 10:14:08 +01:00
|
|
|
cache()->rememberForever(
|
2021-11-09 10:34:22 +01:00
|
|
|
'translations_'.app()->getLocale(),
|
2021-12-06 19:12:53 +01:00
|
|
|
fn () => Json::decode(file_get_contents(resource_path('lang/'.app()->getLocale().'.json')))
|
2021-11-09 10:14:08 +01:00
|
|
|
);
|
2021-07-30 19:26:02 +02:00
|
|
|
}
|
|
|
|
}
|