---
title: "Installation — Opening Hours for Laravel | Roundly"
description: "Install via Composer, publish and run the six migrations, and optionally publish the config and the en/sk translations."
url: https://roundly-consulting.com/open-source/docs/opening-hours-for-laravel/installation
language: en
---

[All packages](https://roundly-consulting.com/open-source.md)

[Opening Hours for Laravel](https://roundly-consulting.com/open-source/docs/opening-hours-for-laravel.md)

# Installation

Require the package, then publish and run the migrations — six tables, all prefixed opening\_hours\_. The service provider is auto-discovered, so there is nothing to register:

```bash
composer require roundly-consulting/opening-hours-for-laravel

php artisan vendor:publish --tag="opening-hours-migrations"
php artisan migrate
```

The config file and the translations (en, sk) are optional — publish them only to override defaults or wording:

```bash
php artisan vendor:publish --tag="opening-hours-config"
php artisan vendor:publish --tag="opening-hours-translations"
```

## Publish tags

| Tag | Publishes |
| --- | --- |
| `opening-hours-migrations` | Six timestamped migrations — publish-only; nothing is auto-loaded. |
| `opening-hours-config` | config/opening-hours.php |
| `opening-hours-translations` | lang/vendor/opening-hours/{en,sk} |

## UUID and ULID owners

If the models that own opening hours use UUID or ULID keys, set OPENING\_HOURS\_KEY\_TYPE before running the migrations — it decides the owner\_id column type in opening\_hours\_calendars and opening\_hours\_intervals. Matching ignores case and padding; any other value throws the toolkit’s InvalidConfigurationException when the migrations run:

```bash
# bigint (default), uuid or ulid — set before running the migrations
OPENING_HOURS_KEY_TYPE=uuid
```

## Recommended scheduling

Two maintenance commands are meant to run daily — pruning (once prune.\* is configured) and interval materialization (only with materialize.enabled):

```php
// routes/console.php
use Illuminate\Support\Facades\Schedule;

Schedule::command('opening-hours:prune')->daily();         // with prune.* configured
Schedule::command('opening-hours:materialize')->daily();   // only with materialize.enabled
```

## Show your open-source love

This package is free and MIT-licensed. If it saves you time, a one-off donation or a Patreon membership keeps it maintained, tested and documented.

[More ways to support, including crypto](https://roundly-consulting.com/support-us.md)

By donating, you agree to our [donation terms](https://roundly-consulting.com/donation-terms.md).

[Support our open source work (opens in a new tab)](https://donate.stripe.com/dRmeVe8FX5PF1Qd9pXcEw00) [Join us on Patreon (opens in a new tab)](https://www.patreon.com/cw/roundly)

## Want this built into your product?

We integrate our packages into custom Laravel and AI builds. Tell us what you're working on and we'll reply within 48 hours.

[Get a quote in 48 hours](https://roundly-consulting.com/contact.md) [Browse all packages](https://roundly-consulting.com/open-source/docs/opening-hours-for-laravel.md)
