alkoumi / carbon-date-translator
Laravel package to translate carbon date to our Amazing 💝 Arabic language even the future dates. to look like [منذ ٥ دقائق] , [بعد سبع ساعات]
This package's canonical repository appears to be gone and the package has been frozen as a result.
v1.5.4
2019-12-27 10:45 UTC
Requires
- php: >=5.5.9
- nesbot/carbon: *
This package is auto-updated.
Last update: 2023-08-27 19:14:12 UTC
README
Laravel package to translate carbon date to our Amazing 💝 Arabic language even the future dates. to look like [قبل ٥ دقائق] , [بعد سبع ساعات]
Installation Up to Laravel 6
You can install the package via composer:
composer require alkoumi/carbon-date-translator
The service provider will automatically get registered. Or you may manually add the service provider in your config/app.php
file:
'providers' => [
// ...
Alkoumi\CarbonDateTranslator\CarbonDateTranslatorServiceProvider::class,
];
Usage
Simply pass an instance of carbon $date
to the method TransDate::inArabic($date)
$row = App\User::first(); $differenceInArabic = TransDate::inArabic($row->created_at); // Result1 => "قبل سبع ساعات" // Result2 => "بعد سبع ساعات"