PHPackages                             rachidlaasri/travel - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. rachidlaasri/travel

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

rachidlaasri/travel
===================

Framework agnostic PHP package to control the time.

1.06(5y ago)283183.6k↓45.9%12[1 issues](https://github.com/rashidlaasri/travel/issues)2MITPHPPHP &gt;=7.2CI failing

Since May 17Pushed 4mo ago6 watchersCompare

[ Source](https://github.com/rashidlaasri/travel)[ Packagist](https://packagist.org/packages/rachidlaasri/travel)[ Docs](https://github.com/rashidlaasri/travel)[ RSS](/packages/rachidlaasri-travel/feed)WikiDiscussions master Synced 2w ago

READMEChangelog (8)Dependencies (2)Versions (10)Used By (2)

[![rashidlaasri travel](https://user-images.githubusercontent.com/36804104/82325079-274ca780-99ca-11ea-8c3d-afd163d1bba0.png)](https://user-images.githubusercontent.com/36804104/82325079-274ca780-99ca-11ea-8c3d-afd163d1bba0.png)

 [![StyleCI](https://camo.githubusercontent.com/f24e9626cbbbf3d365ba3cd81e522af0aeaa1b37635fd60b60e781d23d90c518/68747470733a2f2f7374796c6563692e696f2f7265706f732f3236343631343831362f736869656c643f6272616e63683d6d6173746572)](https://camo.githubusercontent.com/f24e9626cbbbf3d365ba3cd81e522af0aeaa1b37635fd60b60e781d23d90c518/68747470733a2f2f7374796c6563692e696f2f7265706f732f3236343631343831362f736869656c643f6272616e63683d6d6173746572) [![License](https://camo.githubusercontent.com/7c317998f16a3300cd323618077b860d7b3dd862d1bad37dd14723ea6cd35ce0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7261736869646c61617372692f74726176656c)](https://camo.githubusercontent.com/7c317998f16a3300cd323618077b860d7b3dd862d1bad37dd14723ea6cd35ce0/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f7261736869646c61617372692f74726176656c) [![Travis Ci build](https://camo.githubusercontent.com/0674e9d953dc90de3457b3b35e1d40abe0fb7c936047cfed02227ebd96dee469/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7261736869646c61617372692f74726176656c2f6d6173746572)](https://camo.githubusercontent.com/0674e9d953dc90de3457b3b35e1d40abe0fb7c936047cfed02227ebd96dee469/68747470733a2f2f696d672e736869656c64732e696f2f7472617669732f7261736869646c61617372692f74726176656c2f6d6173746572) [![Latest Version on Packagist](https://camo.githubusercontent.com/fb4170120a43e3b00baf93c899fee44e3f821f7e443fdd08af02d97ae38154a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7261636869646c61617372692f74726176656c2e737667)](https://camo.githubusercontent.com/fb4170120a43e3b00baf93c899fee44e3f821f7e443fdd08af02d97ae38154a1/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f7261636869646c61617372692f74726176656c2e737667) [![Total Downloads](https://camo.githubusercontent.com/7b2bb1160f03900ea243604b1ca2742689331a4647c7b5dea5e97799a8136ee3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7261636869646c61617372692f74726176656c2e737667)](https://camo.githubusercontent.com/7b2bb1160f03900ea243604b1ca2742689331a4647c7b5dea5e97799a8136ee3/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f7261636869646c61617372692f74726176656c2e737667)

Travel is a framework agnostic wrapper around [Carbon](https://github.com/briannesbitt/Carbon), it helps you travel to a certain date and travel back to today's date in a readable way.

Installation
------------

[](#installation)

You can install the package via composer:

```
composer require --dev rachidlaasri/travel
```

Usage
-----

[](#usage)

Travel to a certain date with:

```
public function testBasicTest()
{
    Travel::to('01-01-2009');

    // Date is now 01-01-2009
    // code goes here...
}
```

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

```
public function testBasicTest()
{
    // Verify that the user cannot update a post after 10 minutes of its creation time.
    $post = factory(App\Post::class)->create();

    Travel::to('10 minutes', function() use ($post) {
        $this->postJson(route('posts.edit', $post->id), [])
            ->assertStatus(403);
    });
}
```

Travel to multiple dates with:

```
public function testBasicTest()
{
    // Travel to multiple dates:
    Travel::each(['01-01-2009', '04-02-2009', '03-02-2006'], function() {
        // Do something.
    });
}
```

Reset the date to today's date

```
Travel::back();
```

### Testing

[](#testing)

```
composer test
```

### Changelog

[](#changelog)

Please see [CHANGELOG](CHANGELOG.md) for more information on what has changed recently.

Treeware
--------

[](#treeware)

You're free to use this package, but if it makes it to your production environment I would highly appreciate you buying the world a tree.

It’s now common knowledge that one of the best tools to tackle the climate crisis and keep our temperatures from rising above 1.5C is to [plant trees](https://www.bbc.co.uk/news/science-environment-48870920). If you contribute to my forest you’ll be creating employment for local families and restoring wildlife habitats.

You can buy trees at [offset.earth/treeware](https://plant.treeware.earth/rashidlaasri/travel)

Read more about Treeware at

###  Health Score

49

—

FairBetter than 94% of packages

Maintenance52

Moderate activity, may be stable

Popularity51

Moderate usage in the ecosystem

Community25

Small or concentrated contributor base

Maturity57

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 74.4% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~270 days

Recently: every ~482 days

Total

9

Last Release

121d ago

PHP version history (2 changes)1.0.0PHP ^7.2

1.0.6PHP &gt;=7.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/36804104?v=4)[Rachid Laasri](/maintainers/rashidlaasri)[@rashidlaasri](https://github.com/rashidlaasri)

---

Top Contributors

[![rashidlaasri](https://avatars.githubusercontent.com/u/36804104?v=4)](https://github.com/rashidlaasri "rashidlaasri (32 commits)")[![paulredmond](https://avatars.githubusercontent.com/u/177773?v=4)](https://github.com/paulredmond "paulredmond (4 commits)")[![simonschaufi](https://avatars.githubusercontent.com/u/941794?v=4)](https://github.com/simonschaufi "simonschaufi (3 commits)")[![ottoszika](https://avatars.githubusercontent.com/u/7945963?v=4)](https://github.com/ottoszika "ottoszika (2 commits)")[![adapik](https://avatars.githubusercontent.com/u/10532067?v=4)](https://github.com/adapik "adapik (1 commits)")[![cngJo](https://avatars.githubusercontent.com/u/17183555?v=4)](https://github.com/cngJo "cngJo (1 commits)")

---

Tags

carbondatetimetimecarbontravel

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rachidlaasri-travel/health.svg)

```
[![Health](https://phpackages.com/badges/rachidlaasri-travel/health.svg)](https://phpackages.com/packages/rachidlaasri-travel)
```

###  Alternatives

[illuminate/support

The Illuminate Support package.

583115.4M45.3k](/packages/illuminate-support)[spatie/holidays

Calculate public holidays

402955.7k2](/packages/spatie-holidays)[craftcms/feed-me

Import content from XML, RSS, CSV or JSON feeds into entries, categories, Craft Commerce products, and more.

292960.7k38](/packages/craftcms-feed-me)[solspace/craft-freeform

The most flexible and user-friendly form building plugin!

54686.7k25](/packages/solspace-craft-freeform)[pimcore/data-importer

Adds a comprehensive import functionality to Pimcore Datahub

47889.0k6](/packages/pimcore-data-importer)[japanese-date/japanese-date

日本の暦、祝日を取り扱うライブラリ

1610.1k](/packages/japanese-date-japanese-date)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
