cino / laravel-chronos by cino

Replaces Carbon in Laravel by CakePHP's Chronos library
12
9
3
Package Data
Maintainer Username: cino
Package Create Date: 2020-04-01
Package Last Update: 2020-04-14
Home Page:
Language: PHP
License: MIT
Last Refreshed: 2024-11-23 03:20:56
Package Statistics
Total Downloads: 12
Monthly Downloads: 0
Daily Downloads: 0
Total Stars: 9
Total Watchers: 3
Total Forks: 0
Total Open Issues: 0

Laravel Chronos

This package is for enabling the usage of Chronos in Laravel, this will not cover all cases but at least gives you Chronos instances in favor of Carbon, most of the time. (You'll see that in the Laravel source there are enough cases where it calls Carbon directly.)

Installation

The preferred method of installation is via Composer. Run the following command to install the package and add it as a requirement to your project's composer.json:

composer require cino/laravel-chronos

Usage

The only thing you need to do is change your models to extend the Model class from this package. When you do this all functions that interact with dates are overridden to return a Chronos object.


use Cino\LaravelChronos\Eloquent\Model;

class MyModel extends Model
{

}

License

This open-source software is licenced under the MIT license.