initial import
This commit is contained in:
30
app/Providers/AppServiceProvider.php
Normal file
30
app/Providers/AppServiceProvider.php
Normal file
@@ -0,0 +1,30 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user