mmeshkatian / persian-carbon
Carbon persian date
1.0.0
2023-10-17 17:03 UTC
Requires
- php: >=7.0
- morilog/jalali: >=v2.0
- nesbot/carbon: >=1.0
README
A simple wrapper to convert Carbon dates to jalali date.
its uses morilog/jalali package
Requirements
- PHP >= 7.0.0
- Laravel >= 5.4.0
Installation
Install the package through Composer.
Run the Composer require command from the Terminal:
composer require mmeshkatian/persian-carbon
If you're using Laravel > 5.5, this is all there is to do.
Should you still be on version 5.4 of Laravel, the final steps for you are to add the service provider of the package and alias the package. To do this open your config/app.php
file.
Add a new line to the providers
array:
Mmeshkatian\Ariel\PersianCarbonServiceProvider::class
Now you're ready to start using the persian carbon in your application.
Usage
you can simply convert Carbon to persian date
<?php echo now()->toPersian()->format("Y-m-d")
Made With ❤️