PHPackages                             mateusjunges/laravel-time-helpers - 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. mateusjunges/laravel-time-helpers

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

mateusjunges/laravel-time-helpers
=================================

A simple collection of time helpers.

v1.1.0(3y ago)381002MITPHPPHP ^8.0

Since Nov 21Pushed 3y ago1 watchersCompare

[ Source](https://github.com/mateusjunges/laravel-time-helpers)[ Packagist](https://packagist.org/packages/mateusjunges/laravel-time-helpers)[ GitHub Sponsors](https://github.com/mateusjunges)[ RSS](/packages/mateusjunges-laravel-time-helpers/feed)WikiDiscussions master Synced 3d ago

READMEChangelog (3)Dependencies (2)Versions (5)Used By (0)

Laravel Time Helpers
====================

[](#laravel-time-helpers)

[![Laravel time helpers logo](docs/Laravel-Time-Helpers.png)](docs/Laravel-Time-Helpers.png)

[![Latest Version on Packagist](https://camo.githubusercontent.com/134d3cc76e1762e7d787f5ea49a87aa669292d65f5d0404f94e3f6e86876e9c0/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6d61746575736a756e6765732f6c61726176656c2d74696d652d68656c706572732e7376673f7374796c653d666c6174)](https://packagist.org/packages/mateusjunges/laravel-time-helpers)[![Total Downloads](https://camo.githubusercontent.com/d965df2fc981f94d5ba0ddbce4f90f4cb1172d8a81fc78355934bde87796712f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6d61746575736a756e6765732f6c61726176656c2d74696d652d68656c706572732e7376673f7374796c653d666c6174)](https://packagist.org/packages/mateusjunges/laravel-time-helpers)[![](https://github.com/mateusjunges/laravel-time-helpers/workflows/Continuous%20Integration/badge.svg)](https://github.com/mateusjunges/laravel-time-helpers/workflows/Continuous%20Integration/badge.svg)[![MIT Licensed](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](LICENSE.md)[![StyleCI](https://camo.githubusercontent.com/587b8e7560daf2d56113037ae9222f12d8f8300c3dbfe0d7e93179c393508368/68747470733a2f2f7374796c6563692e696f2f7265706f732f3331343833373536392f736869656c643f7374796c653d666c6174)](https://styleci.io/repos/314837569)

This package provides two simple helpers to deal with time.

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

[](#installation)

To install this package, use this command:

```
composer require mateusjunges/laravel-time-helpers
```

The `past` function
-------------------

[](#the-past-function)

The `past` function, as the time suggests, returns a time in the past.

You can use it and chain with the following methods:

- `past(10)->seconds()`: Returns a Carbon instance 10 seconds in the past
- `past(10)->minutes()`: Returns a Carbon instance 10 minutes in the past
- `past(10)->hours()`: Returns a Carbon instance 10 hours in the past
- `past(10)->weeks()`: Returns a Carbon instance 10 weeks in the past
- `past(10)->weekDays()`: Returns a Carbon instance 10 week days in the past
- `past(10)->months()`: Returns a Carbon instance 10 months in the past
- `past(10)->years()`: Returns a Carbon instance 10 years in the past
- `past(10)->centuries()`: Returns a Carbon instance 10 centuries in the past

The `in` function
-----------------

[](#the-in-function)

The `in` function can be used to get a Carbon instance in the future.

You can chain it with the exact same methods used in the `past` function:

- `in(10)->seconds()`: Returns a Carbon instance 10 seconds in the future
- `in(10)->minutes()`: Returns a Carbon instance 10 minutes in the future
- `in(10)->hours()`: Returns a Carbon instance 10 hours in the future
- `in(10)->weeks()`: Returns a Carbon instance 10 weeks in the future
- `in(10)->weekDays()`: Returns a Carbon instance 10 week days in the future
- `in(10)->months()`: Returns a Carbon instance 10 months in the future
- `in(10)->years()`: Returns a Carbon instance 10 years in the future
- `in(10)->centuries()`: Returns a Carbon instance 10 centuries in the future

All methods returns a `Carbon\Carbon` instance, which means you will still be able to use all the `Carbon` methods.

Test
----

[](#test)

To test this package, run `composer test`

Contributing
------------

[](#contributing)

Thanks for considering contributing for this package! The contribution guide can be found [here](https://github.com/mateusjunges/laravel-time-helpers/blob/master/.github/CONTRIBUTING.md).

Changelog
---------

[](#changelog)

Please see the [changelog](https://github.com/mateusjunges/laravel-time-helpers/blob/master/CHANGELOG.md) for more information about the changes on this package.

Credits
-------

[](#credits)

- [Mateus Junges](https://twitter.com/mateusjungess)

License
-------

[](#license)

The Laravel Time Helper package is open-sourced software licensed under the [MIT License](https://opensource.org/licenses/MIT). Please, see the [license file](https://github.com/mateusjunges/laravel-time-helpers/blob/master/LICENSE)for more information.

###  Health Score

31

—

LowBetter than 68% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity20

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity61

Established project with proven stability

 Bus Factor1

Top contributor holds 100% 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 ~289 days

Total

3

Last Release

1422d ago

PHP version history (2 changes)1.0.0PHP ^7.4

v1.1.0PHP ^8.0

### Community

Maintainers

![](https://www.gravatar.com/avatar/83f45321b6bd97953b0c414e70d700f5adfdc031fc1eabae2fe7e8ce2470babf?d=identicon)[mateusjunges](/maintainers/mateusjunges)

---

Top Contributors

[![mateusjunges](https://avatars.githubusercontent.com/u/19756164?v=4)](https://github.com/mateusjunges "mateusjunges (61 commits)")

---

Tags

carbonlaravelphp74time

### Embed Badge

![Health badge](/badges/mateusjunges-laravel-time-helpers/health.svg)

```
[![Health](https://phpackages.com/badges/mateusjunges-laravel-time-helpers/health.svg)](https://phpackages.com/packages/mateusjunges-laravel-time-helpers)
```

###  Alternatives

[barryvdh/laravel-ide-helper

Laravel IDE Helper, generates correct PHPDocs for all Facade classes, to improve auto-completion.

14.9k123.0M687](/packages/barryvdh-laravel-ide-helper)[orchestra/canvas

Code Generators for Laravel Applications and Packages

21017.2M158](/packages/orchestra-canvas)[illuminate/pipeline

The Illuminate Pipeline package.

9446.6M213](/packages/illuminate-pipeline)[illuminate/pagination

The Illuminate Pagination package.

10532.5M862](/packages/illuminate-pagination)[spatie/laravel-pjax

A pjax middleware for Laravel 5

513371.8k11](/packages/spatie-laravel-pjax)[spatie/laravel-mix-preload

Add preload and prefetch links based your Mix manifest

169176.0k2](/packages/spatie-laravel-mix-preload)

PHPackages © 2026

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