Skip to content
This repository has been archived by the owner on Sep 11, 2019. It is now read-only.

mewebstudio/Larbon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Laravel 5 Larbon Package

Based on Carbon

The Larbon Service Provider can be installed via Composer by requiring the mews/larbon package and setting the minimum-stability to dev (required for Laravel 5) in your project's composer.json.

{
    "require": {
        "laravel/framework": "5.1.*",
        "mews/larbon": "~1.0"
    },
    "minimum-stability": "dev"
}

or

Require this package with composer:

composer require mews/larbon

Update your packages with composer update or install with composer install.

Usage

To use the Larbon Service Provider, you must register the provider when bootstrapping your Laravel application. There are essentially two ways to do this.

Find the providers key in config/app.php and register the Laravel Service Provider.

'providers' => [
    // ...
    Mews\Larbon\LarbonServiceProvider::class,
]

Find the aliases key in config/app.php.

'aliases' => [
    // ...
    'Larbon' => Mews\Larbon\Facades\Larbon::class,
]

Example Usage

Larbon::now()->format('l j F Y H:i:s');

// or

larbon()->format('l j F Y H:i:s');
$dtToronto = larbon()->createFromDate(2012, 1, 1, 'America/Toronto');
$dtVancouver = larbon()->createFromDate(2012, 1, 1, 'America/Vancouver');

echo $dtVancouver->diffInHours($dtToronto); // 3

Carbon Docs

http://carbon.nesbot.com/docs/

^_^

Links

About

Laravel 5 Larbon - Carbon Service Provider

Resources

License

MIT, Unknown licenses found

Licenses found

MIT
LICENSE
Unknown
LICENCE.md

Stars

Watchers

Forks

Packages

No packages published

Languages