If you use newer version of Laravel with php8+ and Carbon 2 and use UTC as default timezone (like they suggest) you will encounter some issues using translatedFormat as it's not gonna convert hours.
Here is a suggestion, i use a Carbon macro to simplify. In AppServiceProvider.php boot method, you should add this (using french locale) :
//set defaults for Carbon --------------------------------------------------------------------------------------
setlocale(LC_TIME, app()->getLocale());
date_default_timezone_set(config('app.timezone'));
Carbon::setLocale(app()->getLocale());
//for displaying dates with good timezone translation, we force to french !
$userSettings = [
'locale' => 'fr',
'timezone' => 'Europe/Paris',
'format' => 'd M Y H:i'
];
//register a macro to be a shortcut for displaying dates !
Carbon::macro('display', function () use ($userSettings) {
return $this->copy()->locale($userSettings['locale'])->tz($userSettings['timezone'])->translatedFormat($userSettings['format']);
});
//-------------------------------------------------------------------------------------- set defaults for Carbon
Then when you work with a Carbon UTC date (as this is the default timezone), you can use the macro to convert it to your locale and timezone before calling translatedFormat. Example in a blade file where $message->created_at is my Carbon date.
<div class="fs-6 text-muted">{{$message->created_at->display()}}</div>