Feature: Adding Locale Middleware

This commit is contained in:
2026-08-05 23:58:53 +03:00
parent 4c00369005
commit 93469d033f
4 changed files with 192 additions and 0 deletions
+6
View File
@@ -4,12 +4,15 @@ namespace Modules\Core\Providers;
use Illuminate\Support\Facades\Blade;
use Illuminate\Support\ServiceProvider;
use Lunar\Models\Language;
use Modules\Core\Command\AnonymizeCommand;
use Modules\Core\Command\ExportCleanupCommand;
use Modules\Core\Command\ExportCommand;
use Modules\Core\Command\ImportCommand;
use Modules\Core\Command\InstallLunarCommand;
use Modules\Core\Command\MigrateImportCommand;
use Modules\Core\Localization\LanguageCacheObserver;
use Modules\Core\Localization\LocaleMiddleware;
class CoreServiceProvider extends ServiceProvider
{
@@ -24,6 +27,9 @@ class CoreServiceProvider extends ServiceProvider
Blade::anonymousComponentPath(__DIR__ . '/../../resources/views', 'core');
$this->loadMigrationsFrom(__DIR__ . '/../../database/migrations');
$this->app['router']->aliasMiddleware('locale', LocaleMiddleware::class);
Language::observe(LanguageCacheObserver::class);
$this->publishes([
__DIR__ . '/../../config/core.php' => config_path('core.php'),
__DIR__ . '/../../config/scout.php' => config_path('scout.php'),