---
title: "Configuration — Requests for Laravel | Roundly"
description: "Every config/requests.php key and its default — model, author key type, transition guard, TTL and facade alias."
url: https://roundly-consulting.com/open-source/docs/requests-for-laravel/configuration
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)

# Configuration

The package works without a published config. The full config/requests.php:

```php
// config/requests.php
return [
    'model' => RoundlyConsulting\Requests\Models\Request::class,

    // bigint, uuid or ulid — the key type of the polymorphic author column
    'key_type' => env('REQUESTS_KEY_TYPE', 'bigint'),

    // bigint, uuid or ulid — the requests table's own id; match APPROVALS_KEY_TYPE
    'primary_key_type' => env('REQUESTS_PRIMARY_KEY_TYPE', 'bigint'),

    'enforce_transitions' => false,
    'default_ttl' => null,
    'register_facade_alias' => true,
];
```

## Every key

| Key | Default | Purpose |
| --- | --- | --- |
| `model` | Request::class | The request model used to create and query requests. Point it at a subclass to extend behaviour; a class that does not extend the packaged Request throws InvalidConfigurationException. |
| `key_type` | bigint | Key type of the polymorphic author column — bigint, uuid or ulid (env REQUESTS\_KEY\_TYPE). Read when the migration runs; any other value throws InvalidConfigurationException. |
| `primary_key_type` | bigint | Key type of the requests table’s own id — bigint, uuid or ulid (env REQUESTS\_PRIMARY\_KEY\_TYPE). The approvals engine’s subject and approvable columns point at this id, so set it to the same value as approvals.key\_type. With uuid or ulid the ids are minted when a request is created (time-ordered uuid7 / ulid) and route binding checks the format. Fixed once the migration runs; any other value throws InvalidConfigurationException. |
| `enforce_transitions` | false | Enforce the lifecycle graph: illegal moves throw InvalidStatusTransition. Also gates the engine-to-status sync listener. Env strings true/1/on/yes and false/0/off/no work, a blank value is not set (so false); anything else throws InvalidConfigurationException. |
| `default_ttl` | null | Minutes. Requests created without an explicit expiry get expires\_at = now() + ttl, and a reopened request whose deadline already passed gets a fresh one the same way. Not set (null or blank) = never expire automatically; anything but a positive whole number (at most 52560000, a hundred years) throws InvalidConfigurationException. |
| `register_facade_alias` | true | Register the short Requests class alias. Skipped automatically if the host already aliased the name; the fully-qualified facade always works. A blank value is not set (so true); a value that isn’t a boolean spelling throws InvalidConfigurationException. |

## Environment

The two key types are env-backed — set them before the migration runs, since they shape the author\_id and id columns. requests.primary\_key\_type must match the approvals engine’s APPROVALS\_KEY\_TYPE (Installation):

```bash
# UUID-keyed authors and approvers — set before migrating
REQUESTS_KEY_TYPE=uuid
APPROVALS_KEY_TYPE=uuid
REQUESTS_PRIMARY_KEY_TYPE=uuid
```

Values from env() arrive as strings and are read accordingly: '60' is a 60-minute TTL, and 'true'/'1'/'on'/'yes' (or 'false'/'0'/'off'/'no') switch the two flags. A blank value ('' or whitespace, a bare KEY= line) is not set and takes the default. Any other flag value throws InvalidConfigurationException instead of quietly reading as the default.

## Custom request model

Extend the packaged model to add relations, accessors or behaviour, then point requests.model at it. The builder, the author relations and the requests:expire command all resolve the configured class:

```php
namespace App\Models;

use RoundlyConsulting\Requests\Models\Request;

class ExpenseClaim extends Request
{
    // Keep the package table — a subclass would otherwise look for "expense_claims".
    protected $table = 'requests';
}

// config/requests.php
'model' => App\Models\ExpenseClaim::class,
```

The configured class must be RoundlyConsulting\\Requests\\Models\\Request or a subclass of it, since anything else could not answer the scopes, the status lifecycle or the approval flow. A foreign model — or a class that doesn’t exist — throws InvalidConfigurationException naming requests.model instead of being silently replaced by the packaged model.

## Approval engine settings

The approval mechanics — rules, staged pipelines, delegation, expiry and named workflow presets — are configured in config/approvals.php, owned by approvals-for-laravel. Publish it with the approvals-config tag when you want to define workflow presets.

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