---
title: "Installation — Requests for Laravel | Roundly"
description: "Install via Composer, then publish and run both the requests and the approvals-engine migrations."
url: https://roundly-consulting.com/open-source/docs/requests-for-laravel/installation
language: en
---

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

[Requests for Laravel](https://roundly-consulting.com/open-source/docs/requests-for-laravel.md)

# Installation

Require the package. The service provider is auto-discovered, and its two hard dependencies — approvals-for-laravel (the approval engine) and enums-for-laravel — install automatically:

```bash
composer require roundly-consulting/requests-for-laravel
```

## Migrations

Publish and run the migrations. The package does not auto-load them — publishing copies the requests migration into your database/migrations, where you own it, so a bare php artisan migrate before publishing creates nothing:

```bash
php artisan vendor:publish --tag="requests-migrations"
php artisan vendor:publish --tag="approvals-migrations"
php artisan migrate
```

The package owns the requests table; the approvals, approval\_requests, approval\_request\_stages and approval\_delegations tables belong to the approvals engine, so publish its migrations too. Republishing lands on the same file rather than adding a second copy.

## Key types — set before migrating

The migrations read the key types once, when they first run. Numeric ids need nothing; for UUID or ULID keys set:

| Env | Config | Set it when |
| --- | --- | --- |
| `REQUESTS_KEY_TYPE` | `requests.key_type` | The models that author requests have UUID or ULID keys. |
| `APPROVALS_KEY_TYPE` | `approvals.key_type` | The approvers (and every other model the approvals engine points at) have UUID or ULID keys. |
| `REQUESTS_PRIMARY_KEY_TYPE` | `requests.primary_key_type` | Always — to the same value as APPROVALS\_KEY\_TYPE, since the engine’s subject and approvable columns point at the request id. |

A host with UUID authors and approvers sets all three to uuid. Leaving REQUESTS\_PRIMARY\_KEY\_TYPE at bigint under APPROVALS\_KEY\_TYPE=uuid fails on PostgreSQL (invalid input syntax for type uuid) at the first request with approvers or the first decision, while MySQL and SQLite store the integer silently. Nothing compares the pair at boot or at migrate time, so set both before you migrate (see Configuration).

## Optional assets

Publish the config files or the exception translations only when you need to override them — the exception messages already ship in English and Slovak:

```bash
php artisan vendor:publish --tag="requests-config"
php artisan vendor:publish --tag="approvals-config"
php artisan vendor:publish --tag="requests-translations"
```

## Next steps

- Add GivesApprovals to the models that approve, and HasRequests to the models that submit (Model setup).
- Create your first request with Requests::make() (Creating requests).
- Schedule requests:expire if requests should lapse (Cancel & expire).

## 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/requests-for-laravel.md)
