Download the PHP package seiler/eloquent-date without Composer
On this page you can find all versions of the php package seiler/eloquent-date. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package eloquent-date
Eloquent-Date
This trait replaces Carbon with Jenssegers\Date in Laravel's Eloquent model.
Jenssegers\Date extends Carbon with multi-language support. Methods such as format
, diffForHumans
, parse
, createFromFormat
and the new timespan
, will now be translated based on your locale.
This package is compliant with PSR-1, PSR-2 and PSR-4. If you notice compliance oversights, please send a patch via pull request.
Laravel compatibility
Laravel | Eloquent-Date |
---|---|
5.6 | 5.6 |
5.5 | 5.5 |
5.4 | 5.4 |
5.3 | 5.3 |
5.2 | 5.2 |
Installation
Install using composer:
If you want to use Jenssegers\Date in other part of your application, there is a service provider included in the package for integration with the Laravel framework. This provider will get the application locale setting and use this for translations. To register the service provider, add the following to the providers array in config/app.php
:
You can also add it as a Facade in config/app.php
:
Languages
The Date package contains language files for the following languages:
- Albanian
- Arabic
- Azerbaijani
- Bangla
- Basque
- Brazilian Portuguese
- Bulgarian
- Catalan
- Croatian
- Chinese Simplified
- Chinese Traditional
- Czech
- Danish
- Dutch
- English
- Esperanto
- Estonian
- Finnish
- French
- Galician
- Georgian
- German
- Greek
- Hebrew
- Hindi
- Hungarian
- Icelandic
- Indonesian
- Italian
- Japanese
- Kazakh
- Korean
- Latvian
- Lithuanian
- Macedonian
- Malay
- Norwegian
- Nepali (नेपाली)
- Polish
- Portuguese
- Persian (Farsi)
- Romanian
- Russian
- Thai
- Serbian (latin)
- Serbian (cyrillic)
- Slovak
- Slovenian
- Spanish
- Swedish
- Turkish
- Turkmen
- Ukrainian
- Uzbek
- Vietnamese
- Welsh
Usage
In your Eloquent model, add the EloquentDate
trait:
Now, any attribute declared in $dates
will be converted to Jenssegers\Date
instance instead of Carbon
:
To learn all you can do with Jenssegers\Date
, please refer to its own documentation.
Contributing
Please see CONTRIBUTING for details.
Security
If you discover any security related issues, please email [email protected] instead of using the issue tracker.
Credits
- Frederic Seiler for the trait
- Jens Segers for the Date library
- All Contributors
License
The MIT License (MIT). Please see License File for more information.