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. rachidlaasri/travel

ActiveLibrary

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

Framework agnostic PHP package to control the time.

1.06(5y ago)283173.6k—3.6%12[1 issues](https://github.com/rashidlaasri/travel/issues)2MITPHPPHP &gt;=7.2

Since May 17Pushed 5y 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 1mo ago

READMEChangelog (7)Dependencies (2)Versions (9)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

41

—

FairBetter than 89% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity51

Moderate usage in the ecosystem

Community23

Small or concentrated contributor base

Maturity56

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 73.8% 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 ~36 days

Recently: every ~55 days

Total

8

Last Release

1937d ago

PHP version history (2 changes)1.0.0PHP ^7.2

1.0.6PHP &gt;=7.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/58811dbab9c7e082a81770e78c2912f60f6fc40f89acdacf65771d9e4a77e014?d=identicon)[rashidlaasri](/maintainers/rashidlaasri)

---

Top Contributors

[![rashidlaasri](https://avatars.githubusercontent.com/u/36804104?v=4)](https://github.com/rashidlaasri "rashidlaasri (31 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

[jenssegers/date

A date library to help you work with dates in different languages

1.8k11.2M80](/packages/jenssegers-date)[carbonphp/carbon-doctrine-types

Types to use Carbon in Doctrine

218220.4M8](/packages/carbonphp-carbon-doctrine-types)[whitecube/laravel-timezones

Store UTC dates in the database and work with custom timezones in the application.

106106.2k](/packages/whitecube-laravel-timezones)

PHPackages © 2026

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