easteregg/intl-carbon

Laravel 5 Package Template
426
Install
composer require easteregg/intl-carbon
Latest Version:0.3.0
License:proprietary
Last Updated:Jan 27, 2026
Links: GitHub  ·  Packagist
Maintainer: easteregg

Build Status

Persian date formatter using php-intl integration into Laravel

This package provides a convenient way to localize and format Eloquent date attributes. using this package, you can localize date attributes of any model to any calendar you want. it looks for the current application locale to generate string.

Installation

  1. run composer require easteregg/intl-carbon
  2. add Easteregg\IntlCarbon\IntlServiceProvider to config/app.php providers.
  3. run php artisan vendor:publish --tag="intl-carbon.config" to publish the config files. (optional)

Usage

Edit the config file and select a calendar for each locale your application might be having

see: (https://secure.php.net/manual/en/class.intldateformatter.php)

For more information about the formatting, checkout this page. Edit your eloquent model and add Easteregg\IntlCarbon\LocalizesDates trait.

example:

<?php

use Easteregg\IntlCarbon\LocalizesDates;

class Post extends Model
{
   use LocalizesDates;
}


You should be good to go. now anywhere in the system, you can call any model date value with a new long() method to format. (e.g. `$post->created_at->long()). Pull requests are welcome for this repository.

Related Packages

gabrieloliverio/laravel5-generators

Database metadata-based generators for Laravel 5

1
erirk/paypalpayment

laravel-paypalpayment is simple package help you process direct credit card paym...

0
doctrine/dbal

Powerful PHP database abstraction layer (DBAL) with many features for database s...

631,580,251 9,707
laravel/framework

The Laravel Framework.

580,311,802 34,925
laravel/tinker

Powerful REPL for the Laravel framework.

489,754,436 7,444