A collection of programming & webdesign
Laravel date language

Obviously, there are several methods of setting up the language of a date in Laravel. I was finally successful with the following one:

1. AppServiceProvider:

public function register()
    {
        setlocale(LC_TIME, config('app.locale'));
    }

2. config > app.php
local environment:  ‘locale’ => ‘de’ 
on the server:  ‘locale’ => ‘de_DE.UTF-8’  → the ‘UTF-8’ actually solved my “March”-problem with the German word “März” which was not displayed correctly without it (it was not displayed at all while all the other months were)

3. in the view with formatLocalized():

 <div>{{ $article→created_at→formatLocalized('%d. %b. %Y') }}</div> 

I read that's just a workaround and a better and more stable solution is to use an array for the months you need. So, this is just the solution that worked for me.