PHPackages                             royscheepens/currently-open - 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. royscheepens/currently-open

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

royscheepens/currently-open
===========================

Currently Open Package for Laravel 5.5+

151PHP

Since Nov 24Pushed 8y ago2 watchersCompare

[ Source](https://github.com/royscheepens/currently-open)[ Packagist](https://packagist.org/packages/royscheepens/currently-open)[ RSS](/packages/royscheepens-currently-open/feed)WikiDiscussions master Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Currently Open
==============

[](#currently-open)

[![Total Downloads](https://camo.githubusercontent.com/cf3119132719414f9230cc7e6c16bccf0f498c313028d6064dce0e2c5867821b/68747470733a2f2f706f7365722e707567782e6f72672f726f79736368656570656e732f63757272656e746c792d6f70656e2f646f776e6c6f616473)](https://packagist.org/packages/royscheepens/currently-open)[![License](https://camo.githubusercontent.com/a4a02be3acf903dc2249f49e4e3ddbaef145ee8f44491a1b40ebd7a070266a4f/68747470733a2f2f706f7365722e707567782e6f72672f726f79736368656570656e732f63757272656e746c792d6f70656e2f6c6963656e7365)](https://packagist.org/packages/royscheepens/currently-open)[![Latest Stable Version](https://camo.githubusercontent.com/452e40c4bac38d142015919d083848aecbd61458d5066e0afbdbc8034e064eb5/68747470733a2f2f706f7365722e707567782e6f72672f726f79736368656570656e732f63757272656e746c792d6f70656e2f762f737461626c65)](https://packagist.org/packages/royscheepens/currently-open)[![Monthly Downloads](https://camo.githubusercontent.com/48a1f9f5360df27d5f1abb2b691c62aec6414ead23eb57c401e79760361b5aa4/68747470733a2f2f706f7365722e707567782e6f72672f726f79736368656570656e732f63757272656e746c792d6f70656e2f642f6d6f6e74686c79)](https://packagist.org/packages/royscheepens/currently-open)

> A simple Laravel Package to determine if a shop is open or closed, based on configurable config settings

This package is built to check whether your business is open, based on configurable settings. It currently supports setting default time slots for the days in a week, and the option to set exceptions based on a certain date.

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

[](#installation)

Install with `composer`:

Laravel 5.4 and above

```
composer require royscheepens/currently-open:^0.1.0

```

And add the service provider in `config/app.php`

```
'providers' => [
    ........,
    RoyScheepens\CurrentlyOpen\CurrentlyOpenServiceProvider::class,
]
```

If you want to use the facade, add this to your facades in `config/app.php`

```
'aliases' => [
    ........,
    'CurrentlyOpen' => RoyScheepens\CurrentlyOpen\CurrentlyOpenFacade::class,
]
```

To publish the configuration file, run

```
php artisan vendor:publish --provider="RoyScheepens\CurrentlyOpen\CurrentlyOpenServiceProvider"

```

Configuration
-------------

[](#configuration)

The only required config value is 'weekdays', which lets you set the opening hours for the days of the week. It is not required to set all days, if a day is not set we assume you're not open.

Exceptions per date are also possible, but not required.

```
return [

    // Add timeslots for each day in the week. Weekdays start at 0 (Sunday)
    'weekdays'      =>  [
        0 => false, // False means we're closed. Set to true to be opened all day
        1 => ['09:00', '17:30'],
        2 => ['09:00', '17:30'],
        3 => ['09:00', '17:30'],
        4 => ['09:00', '17:30'],
        5 => ['09:00', '17:30'],
        6 => ['10:00', '12:30'
    ],

    // Possible exceptions per date. Please note that 'weekday' rules will be overridden
    'exceptions'    =>  [
        '2017-12-25' => false // Closed on Christmas
        '2017-12-26' => ['12:00', '17:30'] // Opening a bit later... *burp*
    ]

];
```

Usage
-----

[](#usage)

All examples are based on the config example above.

```
$result = CurrentlyOpen::check()

var_dump($result->open); // True if we're open, false if not
```

This checks your config with the current date and time, e.g. 'now'. You can also supply a date to check dates in advance. The variable `$date` can be a Carbon instance, or a string parseable by Carbon.

```
$date = '2017-12-25 12:00'; // Let's see if we're open for Christmas
$result = CurrentlyOpen::check($date);

var_dump($result->open); // False
```

The result of the `check()` method also contains a `until` attribute, which lets you know until when you're open. This attribute is returned as a Carbon instance and only included when `open` is true.

```
$date = '2017-12-05 12:00'; // Let's see if we're open this Tuesday in December
$result = CurrentlyOpen::check($date);

var_dump($result->open); // True
var_dump($result->until->toDateTimeString()); // 2017-12-05 17:30:00
```

If you just want to check if you're open, use the method below. It returns a boolean and also accepts a `$date` variable, as seen above.

```
$result = CurrentlyOpen::checkSimple()

var_dump($result) // True if we're open, false if not
```

Future Roadmap
--------------

[](#future-roadmap)

The package is still very basic and could use some more features, like:

- When open for the entire day, `until` should also check for time slots in the following day(s)
- When closed, add the date and time when we're open again
- Support for multiple time slots per day (also for exceptions)
- More robust config checks

###  Health Score

20

—

LowBetter than 14% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity6

Limited adoption so far

Community9

Small or concentrated contributor base

Maturity41

Maturing project, gaining track record

 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.

### Community

Maintainers

![](https://www.gravatar.com/avatar/402ca00bed9edc2499a2669db9b2d7183c1f8454cc413f9fb62c5a39ccefd9f7?d=identicon)[royscheepens](/maintainers/royscheepens)

---

Top Contributors

[![royscheepens](https://avatars.githubusercontent.com/u/248388?v=4)](https://github.com/royscheepens "royscheepens (3 commits)")

### Embed Badge

![Health badge](/badges/royscheepens-currently-open/health.svg)

```
[![Health](https://phpackages.com/badges/royscheepens-currently-open/health.svg)](https://phpackages.com/packages/royscheepens-currently-open)
```

###  Alternatives

[sensiolabs/minify-bundle

Assets Minifier (CSS, JS) for Symfony &amp; Minify integration in Asset Mapper

5694.9k1](/packages/sensiolabs-minify-bundle)[sider/phinder

PHP code piece finder

5445.5k](/packages/sider-phinder)

PHPackages © 2026

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