Closed mohammadyahia123 closed 2 years ago
You can simply use diffForHumans()
method of Cabon package by setting disired locale in config/app.php file or dynamically:
Carbon::setLocale('fa');
echo $record->created_at->diffForHumans(); //۳ روز پیش
You can use ago
method to display human readable and relative datetime
At start I wanted to keep working with some notes that needed to be displayed as human readable time difference, but I coyldn't find the persian format of the diffForHuman method of carbon.