Laravel Date to German Monthnames?

Viewed 63

I have laravel and have this function to print the date when the user registered on our site

{{ __("Member Since :time",["time"=> date("M Y",strtotime($user->created_at))]) }}

But it gives "Oct" (English). But i want this in German. But how can i make this in frontend?

Thats the code in the frontend file

<p class="profile-since">{{ __("Member Since :time",["time"=> date("M Y",strtotime($user->created_at))]) }}</p>
1 Answers

You should use setlocale()

https://www.php.net/setlocale

setlocale(LC_ALL, 'de_DE@euro', 'de_DE', 'de', 'ge');

If you set this before you echo your code it should change to the locale

Or if you use carbon you can change it globally in config/app.php

'locale' => 'id'
Related