31 lines
569 B
PHP
31 lines
569 B
PHP
<?php
|
|
|
|
namespace App\Providers;
|
|
|
|
use Illuminate\Support\ServiceProvider;
|
|
|
|
class AppServiceProvider extends ServiceProvider
|
|
{
|
|
/**
|
|
* Register any application services.
|
|
*/
|
|
public function register(): void
|
|
{
|
|
//
|
|
}
|
|
|
|
/**
|
|
* Bootstrap any application services.
|
|
*/
|
|
public function boot(): void
|
|
{
|
|
$locale = substr(request()->server('HTTP_ACCEPT_LANGUAGE'), 0, 2);
|
|
|
|
if (in_array($locale, ['de'])) {
|
|
app()->setLocale($locale);
|
|
} else {
|
|
app()->setLocale('en');
|
|
}
|
|
}
|
|
}
|