PHPackages                             label84/laravel-hours-helper - 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. label84/laravel-hours-helper

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

label84/laravel-hours-helper
============================

Creates a Collection of times with a given interval.

v1.4.1(2mo ago)27591.2k↓26.5%23MITPHPPHP ^8.2CI passing

Since Jan 2Pushed 2mo ago3 watchersCompare

[ Source](https://github.com/Label84/laravel-hours-helper)[ Packagist](https://packagist.org/packages/label84/laravel-hours-helper)[ RSS](/packages/label84-laravel-hours-helper/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (8)Dependencies (10)Versions (9)Used By (0)

Laravel Hours Helper
====================

[](#laravel-hours-helper)

[![Latest Stable Version](https://camo.githubusercontent.com/d7a8e8bd8c4250433ef58ae06496c990907e9d094cd8b9c33749a89b34e29f11/68747470733a2f2f706f7365722e707567782e6f72672f6c6162656c38342f6c61726176656c2d686f7572732d68656c7065722f762f737461626c653f7374796c653d666c61742d737175617265)](https://packagist.org/packages/label84/laravel-hours-helper)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)[![Total Downloads](https://camo.githubusercontent.com/8028854d070b789cb5938f4f36f9a33cb4f53db23fa8b802e8e05be91f03bee2/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6c6162656c38342f6c61726176656c2d686f7572732d68656c7065722e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/label84/laravel-hours-helper)[![GitHub Workflow Status](https://camo.githubusercontent.com/3819b01f062d5ed74eaa29e67b46911e719b8cb1859352b629a10874ec3c97ec/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6162656c38342f6c61726176656c2d686f7572732d68656c7065722f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)](https://camo.githubusercontent.com/3819b01f062d5ed74eaa29e67b46911e719b8cb1859352b629a10874ec3c97ec/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f6c6162656c38342f6c61726176656c2d686f7572732d68656c7065722f72756e2d74657374732e796d6c3f6272616e63683d6d6173746572267374796c653d666c61742d737175617265)

With `laravel-hours-helper` you can create an `Illuminate\Support\Collection` of dates and/or times with a specific interval for a specific period. This helper could be useful in generating dropdown selections for a calendar meeting invite or scheduling the duration of an event. This helper also allows you to define the date formatting for each interval and to exclude intervals within the specific period.

- [Laravel Support](#laravel-support)
- [Installation](#installation)
- [Usage](#usage)
- [Tests](#tests)
- [License](#license)

Laravel Support
---------------

[](#laravel-support)

VersionRelease13.x^1.412.x^1.411.x^1.4Installation
------------

[](#installation)

Install the package via composer:

```
composer require label84/laravel-hours-helper
```

Usage
-----

[](#usage)

```
use Label84\HoursHelper\Facades\HoursHelper;

$hours = HoursHelper::create('08:00', '09:30', 30);

// Illuminate\Support\Collection
0 => '08:00',
1 => '08:30',
2 => '09:00',
3 => '09:30',
```

### Example 1: time format

[](#example-1-time-format)

```
use Label84\HoursHelper\Facades\HoursHelper;

$hours = HoursHelper::create('11:00', '13:00', 60, 'g:i A');

// Illuminate\Support\Collection
0 => '11:00 AM',
1 => '12:00 PM',
2 => '1:00 PM',
```

### Example 2: exclude times

[](#example-2-exclude-times)

```
use Label84\HoursHelper\Facades\HoursHelper;

$hours = HoursHelper::create('08:00', '11:00', 60, 'H:i', [
    ['09:00', '09:59'],
    // more..
]);

// Illuminate\Support\Collection
0 => '08:00',
1 => '10:00',
2 => '11:00',
```

### Example 3: past midnight

[](#example-3-past-midnight)

```
use Label84\HoursHelper\Facades\HoursHelper;

$hours = HoursHelper::create('23:00', '01:00', 60);

// Illuminate\Support\Collection
0 => '23:00',
1 => '00:00',
2 => '01:00',
```

### Example 4: multiple days

[](#example-4-multiple-days)

```
use Label84\HoursHelper\Facades\HoursHelper;

$hours = HoursHelper::create('2022-01-01 08:00', '2022-01-01 08:30', 15, 'Y-m-d H:i');

// Illuminate\Support\Collection
0 => '2022-01-01 08:00',
1 => '2022-01-01 08:15',
2 => '2022-01-01 08:30',
```

You can find more examples in the test directory: [tests/HoursHelperTest.php](tests/HoursHelperTest.php)

Tests
-----

[](#tests)

```
./vendor/bin/pint
./vendor/bin/phpstan analyze
./vendor/bin/phpunit
```

License
-------

[](#license)

[MIT](https://opensource.org/licenses/MIT)

###  Health Score

59

—

FairBetter than 99% of packages

Maintenance87

Actively maintained with recent releases

Popularity50

Moderate usage in the ecosystem

Community15

Small or concentrated contributor base

Maturity67

Established project with proven stability

 Bus Factor1

Top contributor holds 90.9% 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 ~219 days

Recently: every ~282 days

Total

8

Last Release

63d ago

PHP version history (3 changes)v1.0.0PHP ^7.4 || ^8.0

v1.2.1PHP ^8.0

v1.4.0PHP ^8.2

### Community

Maintainers

![](https://www.gravatar.com/avatar/78c37d1496f19445af6a812d2275c34bbd08dead68aebae70229d7ff0670ed85?d=identicon)[tjardo](/maintainers/tjardo)

---

Top Contributors

[![tjardoo](https://avatars.githubusercontent.com/u/31533540?v=4)](https://github.com/tjardoo "tjardoo (20 commits)")[![laravel-shift](https://avatars.githubusercontent.com/u/15991828?v=4)](https://github.com/laravel-shift "laravel-shift (2 commits)")

---

Tags

laravellaravel-package

###  Code Quality

TestsPHPUnit

Static AnalysisPHPStan

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/label84-laravel-hours-helper/health.svg)

```
[![Health](https://phpackages.com/badges/label84-laravel-hours-helper/health.svg)](https://phpackages.com/packages/label84-laravel-hours-helper)
```

###  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

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

The Illuminate Pipeline package.

9346.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)
