LaravelRUS / localized-carbon

A localizable version of Carbon
138 stars 62 forks source link

Fails with latest Carbon version #82

Closed michaeltintiuc closed 6 years ago

michaeltintiuc commented 7 years ago
Declaration of Laravelrus\LocalizedCarbon\LocalizedCarbon::diffForHumans()
should be compatible with
Carbon\Carbon::diffForHumans(Carbon\Carbon $other = NULL, $absolute = false, $short = false) 
greal commented 7 years ago

I have the same...

DDiimmkkaass commented 7 years ago

And I have this error

michaeltintiuc commented 7 years ago

83 Should fix this, give it a try and let us know!

iooe commented 6 years ago

Почему бы не закрыть вопрос ?

sergyinfo commented 6 years ago

It happens again with latest Carbon

mrKorg commented 6 years ago

I have the same problem with latest Carbon

Amegatron commented 6 years ago

Should be ok now in dev-master

michaeltintiuc commented 6 years ago

Looks good, if anyone could test this and provide a solid confirmation?

mrKorg commented 6 years ago

Я сейчас попробовал. Установил пакет, добавил его в config/app.php Подключил в модели namespace App\Models; use Carbon\Carbon; use \Laravelrus\LocalizedCarbon\Traits\LocalizedEloquentTrait; class Article extends Model { use LocalizedEloquentTrait; ..... } И в blade пишу {{ $article->created_at->format('d M Y') }} Дата выводится на англ - 23 Mar 2018 Может я не так что делаю?

Amegatron commented 6 years ago

@mrKorg Как этот вопрос относится к обсуждаемому багу? А вообще, есть метод formatLocalized

mrKorg commented 6 years ago

Спасибо, работает отлично!

michaeltintiuc commented 6 years ago

Closing as fixed. I wish the dev would have mentioned this issue in the commit though.