Time Travel PHP Library

Time Travel PHP Library

Travel is a small PHP library by Rachid Laasri that wraps around Carbon PHP to help you travel to a specific point in time and back again in a simple, readable way.

The readme outlines the usage, which is designed to be simple and readable:

Travel::to('November 5, 1955');

// Stop Biff

// Get back to the future
Travel::to('October 26, 1985');

My favorite example is running some time-sensitive code in a closure, and then time goes back to the current date after the closure executes:

Travel::to('-5 minutes', function() {
    // Do something.
});

If you start time traveling, make sure you come back to avoid disrupting the time-space continuum:

Travel::back();

You can learn more about this package, get full installation instructions, and view the source code on GitHub at rashidlaasri/travel.

Filed in: News
Laravel News Partners

Laravel Jobs

Medior Laravel Backend Developer (The Netherlands/Dutch only)
Nijmegen, The Netherlands
BigSpark B.V.
Laravel Developer
Remote
Enjin
Senior Laravel Backend Engineer
Remote, USA Only
Kittyhawk.io, Inc.
Full Stack Developer
Rijssen
CODE14
Senior PHP Developer
Remote
ProjectMark

Newsletter

Join 31,000+ others and never miss out on new tips, tutorials, and more.