Skip to content

Framework agnostic PHP package to control the time.

License

Notifications You must be signed in to change notification settings

paulredmond/travel

 
 

Repository files navigation

StyleCI License Travis Ci build Latest Version on Packagist Total Downloads

Travel is a framework agnostic wrapper around Carbon, it helps you travel to a certain date and travel back to today's date in a readable way.

Installation

You can install the package via composer:

composer require rachidlaasri/travel

Usage

Travel to a certain date with:

// Jump to 2009 and watch the last Michael Jackson live performance.
Travel::to('01-01-2009');

Travel to a given date, excute a piece of code and reset:

// Travel to the past and un-say that embarassing thing you said and come back.
Travel::to('-5 minutes', function() {
    // Do something.
});

Reset the date to today's date

Travel::back();

Testing

composer test

Changelog

Please see CHANGELOG for more information on what has changed recently.

License

The MIT License (MIT). Please see License File for more information.

About

Framework agnostic PHP package to control the time.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • PHP 100.0%