Download the PHP package mateusjunges/laravel-time-helpers without Composer
On this page you can find all versions of the php package mateusjunges/laravel-time-helpers. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download mateusjunges/laravel-time-helpers
More information about mateusjunges/laravel-time-helpers
Files in mateusjunges/laravel-time-helpers
Package laravel-time-helpers
Short Description A simple collection of time helpers.
License MIT
Informations about the package laravel-time-helpers
Laravel Time Helpers
This package provides two simple helpers to deal with time.
Installation
To install this package, use this command:
The past
function
The past
function, as the time suggests, returns a time in the past.
You can use it and chain with the following methods:
past(10)->seconds()
: Returns a Carbon instance 10 seconds in the pastpast(10)->minutes()
: Returns a Carbon instance 10 minutes in the pastpast(10)->hours()
: Returns a Carbon instance 10 hours in the pastpast(10)->weeks()
: Returns a Carbon instance 10 weeks in the pastpast(10)->weekDays()
: Returns a Carbon instance 10 week days in the pastpast(10)->months()
: Returns a Carbon instance 10 months in the pastpast(10)->years()
: Returns a Carbon instance 10 years in the pastpast(10)->centuries()
: Returns a Carbon instance 10 centuries in the past
The in
function
The in
function can be used to get a Carbon instance in the future.
You can chain it with the exact same methods used in the past
function:
in(10)->seconds()
: Returns a Carbon instance 10 seconds in the futurein(10)->minutes()
: Returns a Carbon instance 10 minutes in the futurein(10)->hours()
: Returns a Carbon instance 10 hours in the futurein(10)->weeks()
: Returns a Carbon instance 10 weeks in the futurein(10)->weekDays()
: Returns a Carbon instance 10 week days in the futurein(10)->months()
: Returns a Carbon instance 10 months in the futurein(10)->years()
: Returns a Carbon instance 10 years in the futurein(10)->centuries()
: Returns a Carbon instance 10 centuries in the future
All methods returns a Carbon\Carbon
instance, which means you will still be able
to use all the Carbon
methods.
Test
To test this package, run composer test
Contributing
Thanks for considering contributing for this package! The contribution guide can be found here.
Changelog
Please see the changelog for more information about the changes on this package.
Credits
License
The Laravel Time Helper package is open-sourced software licensed under the MIT License. Please, see the license file for more information.