RobDeFlop
RobDeFlop

Reputation: 59

Laravel: Local Dayname is not displaying

I have got a problem with the local dayname.

Code from index.blade.php

{{  Carbon\Carbon::parse($case->created_at)->formatLocalized('%A, %e %B %Y') }}

and the output should be e.g.: Sonntag, 08.04.2018 but it returnsSunday, 08.04.2018

I also added to my AppServiceProvider.php following code:

Carbon::setUTF8(true);
Carbon::setLocale('de');

How can I fix this issue? Thanks in advance

Upvotes: 0

Views: 31

Answers (1)

Ahmed Gad
Ahmed Gad

Reputation: 61

try to set your env locale first

app()->setLocale('de');
Carbon::setLocale('de');
setlocale(LC_TIME, 'German');

Upvotes: 1

Related Questions