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

Senior Full Stack Engineer - Laravel
Remote
Givebutter
Laravel partner seeks Lead Developer
Remote
Kirschbaum Development Group
Senior Programmer **Immediate Opening** (send resume to daniel@sbgcorp.com)
Remote
SBG Corp
Web Developer - Laravel
Grand Forks, North Dakota
Center for Rural Health
Senior Full-Stack Laravel Developer
Berlin, Germany
felmo.de

Newsletter

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