feat: New design and optimization
This commit is contained in:
@@ -2,7 +2,10 @@
|
||||
|
||||
namespace App\Providers;
|
||||
|
||||
use Illuminate\Support\Facades\App;
|
||||
use Illuminate\Support\Facades\Session;
|
||||
use Illuminate\Support\ServiceProvider;
|
||||
use Inertia\Inertia;
|
||||
|
||||
class AppServiceProvider extends ServiceProvider
|
||||
{
|
||||
@@ -19,6 +22,18 @@ class AppServiceProvider extends ServiceProvider
|
||||
*/
|
||||
public function boot(): void
|
||||
{
|
||||
//
|
||||
Inertia::share([
|
||||
'locale' => function () {
|
||||
$locale = Session::get('locale', config('app.locale'));
|
||||
App::setLocale($locale);
|
||||
return $locale;
|
||||
},
|
||||
'translations' => function () {
|
||||
$locale = Session::get('locale', config('app.locale'));
|
||||
App::setLocale($locale);
|
||||
return trans('messages');
|
||||
},
|
||||
]);
|
||||
// App::setLocale(Session::get('locale', config('app.locale')));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user