PHPackages                             joaorbrandao/laravel-intervals - 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. joaorbrandao/laravel-intervals

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

joaorbrandao/laravel-intervals
==============================

This package creates a simple way of adding time intervals to your projects.

v2.0.1(5y ago)5354MITPHPPHP &gt;=7.2.5CI failing

Since Jul 6Pushed 5y agoCompare

[ Source](https://github.com/joaorbrandao/laravel-intervals)[ Packagist](https://packagist.org/packages/joaorbrandao/laravel-intervals)[ Docs](https://github.com/joaorbrandao/laravel-intervals)[ RSS](/packages/joaorbrandao-laravel-intervals/feed)WikiDiscussions master Synced today

READMEChangelog (10)Dependencies (5)Versions (13)Used By (0)

laravel-intervals
=================

[](#laravel-intervals)

This package creates a simple way of adding time intervals to your projects.

[![Latest Stable Version](https://camo.githubusercontent.com/3b81e25b9741319f0e67ca4df6b66a02a6f74bf98f7aca7696fecb47a61081ea/68747470733a2f2f706f7365722e707567782e6f72672f6a6f616f726272616e64616f2f6c61726176656c2d696e74657276616c732f762f737461626c65)](https://packagist.org/packages/joaorbrandao/laravel-intervals)[![Total Downloads](https://camo.githubusercontent.com/a5377306a3c3679cb78f2e34cfb9052bb730b8f87e4cc22ab7bd0dce61e03a9b/68747470733a2f2f706f7365722e707567782e6f72672f6a6f616f726272616e64616f2f6c61726176656c2d696e74657276616c732f646f776e6c6f616473)](https://packagist.org/packages/joaorbrandao/laravel-intervals)[![License](https://camo.githubusercontent.com/9ab67d8a86a36e4f1fcbda6481bc6f836a5cf239774c1515b21078e820f666ad/68747470733a2f2f706f7365722e707567782e6f72672f6a6f616f726272616e64616f2f6c61726176656c2d696e74657276616c732f6c6963656e7365)](https://packagist.org/packages/joaorbrandao/laravel-intervals)

Installing
----------

[](#installing)

```
composer require joaorbrandao/laravel-intervals
```

Publish the package into your application.

```
php artisan vendor:publish --provider=Joaorbrandao\LaravelIntervals\LaravelIntervalsServiceProvider
```

A folder containing some filters will be published in "app/LaravelIntervals".
Feel free to modify/delete them if you want!

Usage
-----

[](#usage)

### Create a new Interval

[](#create-a-new-interval)

This command will create a new interval in "app/LaravelIntervals".

```
php artisan make:interval FirstDayOfLastWeek
```

### Setup the Interval

[](#setup-the-interval)

Each time interval has 5 properties: start, end, enabled, id and name.

PropertyDescriptionstartRepresents the start time of the interval.endRepresents the end time of the interval.enabledEnables/disables the usage of the interval.idIdentifies the interval as unique.nameThe interval's name for translation purposes.After running the command to create the interval, you must change the start and end to match with the interval name.

```
