---
title: 'Configuration basics'
description: "Where LaRecipe's settings live, the few that most apps change (the URL, who may read, where pages are stored), and how to add a second doc set."
url: 'https://larecipe.saleem.dev/3.x/get-started/configuration'
version: 3.x
locale: en
last_updated: '2026-10-18'
---

> Docs index: https://larecipe.saleem.dev/3.x/llms.txt · MCP: https://larecipe.saleem.dev/mcp · Skill: https://larecipe.saleem.dev/skill.md

# Configuration basics

Most apps change nothing at first: the docs live in `docs/`, are served at `/docs`, and anyone may read them. When you want something else, publish the config file:

```bash
php artisan vendor:publish --tag=larecipe-config
```

Then edit your doc set's entry in `config/larecipe.php`. These are the three settings most apps touch:

```php title="config/larecipe.php"
'sets' => [
    'docs' => [
        'route' => ['prefix' => 'docs', 'domain' => null, 'middleware' => ['web']],
        'source' => ['driver' => 'repository', 'path' => base_path('docs')],
        'access' => ['mode' => 'public'],
    ],
],
```

| Setting | What it decides | Values |
| --- | --- | --- |
| `route.prefix` | The URL the docs live under | `docs` by default (`LARECIPE_PREFIX`). `''` puts the docs at the domain root. |
| `source.driver` | Where the pages are stored | `repository` (Markdown files in your repo, recommended) or `database` |
| `access.mode` | Who may read | `public` (everyone), `auth` (anyone signed in) or `gate` (your `viewLarecipe` gate) |

Laravel merges your file over the package's defaults one top-level key at a time, so a key you leave out keeps its default.

## Settings and content live apart

`config/larecipe.php` holds how your app serves the docs. What the docs say and how they look travels with the content, next to the pages:

| File | Holds |
| --- | --- |
| `config/larecipe.php` | Doc sets, routes, the source, access, review mode, cache, search, MCP, agent surfaces, AI |
| `docs/larecipe.json` | The name, logo, theme, versions, languages, navbar, redirects and analytics. See the [manifest reference](https://larecipe.saleem.dev/3.x/reference/manifest.md). |
| `navigation.json` | One version's sidebar. See [navigation](https://larecipe.saleem.dev/3.x/writing/navigation.md). |
| Frontmatter | One page's title, description, sources and the like. See [project structure](https://larecipe.saleem.dev/3.x/get-started/project-structure.md). |

So your coding agent can edit the docs without touching your config. Secrets go in neither: a provider key belongs in `.env`, read by your config.

## Add a second doc set

A doc set is one docs site inside your app, with its own URL, content and agent surfaces. Add another when a different audience needs a different site, such as internal runbooks next to public docs:

```php title="config/larecipe.php"
'sets' => [
    'docs' => [
        // ...
    ],

    'handbook' => [
        'route' => ['prefix' => 'handbook', 'middleware' => ['web', 'auth']],
        'source' => ['driver' => 'repository', 'path' => base_path('handbook')],
        'access' => ['mode' => 'gate'],
        'mcp' => ['web' => ['enabled' => false]],
    ],
],
```

`default` names the set that artisan commands and the local MCP server use when you pass no `--set` (`docs` unless `LARECIPE_DEFAULT_SET` says otherwise). [Gate blocks and private docs](https://larecipe.saleem.dev/3.x/writing/gate-blocks.md) explains the access modes and the gates.

## Everything else

Each other group in the file has its own page:

| Key | Controls | Read |
| --- | --- | --- |
| `review` | Whether your agent asks before it commits docs changes | [Review modes](https://larecipe.saleem.dev/3.x/keeping-current/review-modes.md) |
| `search` | The search driver and the index budget | [Search](https://larecipe.saleem.dev/3.x/operate/search.md) |
| `mcp` | The MCP endpoint for agents and the local server | [The MCP server](https://larecipe.saleem.dev/3.x/agents/mcp.md) |
| `agents` | `llms.txt`, `llms-full.txt`, `skill.md` and the sitemap | [Agent surfaces](https://larecipe.saleem.dev/3.x/agents/surfaces.md) |
| `ai` | Ask AI and `larecipe:sync`, on your own provider key | [Ask AI](https://larecipe.saleem.dev/3.x/agents/ask-ai.md) |
| `cache` | The cache store for rendered pages | [Deployment](https://larecipe.saleem.dev/3.x/operate/deployment.md) |
| `hooks`, `instructions` | The pre-push check and the `AGENTS.md` block | [The pre-push hook](https://larecipe.saleem.dev/3.x/keeping-current/pre-push-hook.md) |
| `ui` | How long a changed page keeps its dot in the sidebar | [Navigation](https://larecipe.saleem.dev/3.x/writing/navigation.md) |

The [configuration reference](https://larecipe.saleem.dev/3.x/reference/configuration.md) lists every key, its default and its environment variable.

## Details

**Mount the docs at the domain root**

A prefix of `''` makes the set own the domain root. This site works that way: [larecipe.saleem.dev](https://larecipe.saleem.dev) opens on the Introduction page, with no separate homepage. Here is its entry, from this app's own `config/larecipe.php`:

```php title="config/larecipe.php"
'sets' => [
    'docs' => [
        'route' => [
            'prefix' => '',   // larecipe.saleem.dev opens on the docs: the set owns the domain root
            'domain' => null,
            'middleware' => ['web'],
        ],
        'source' => [
            'driver' => 'repository',
            'path' => base_path('docs'),
        ],
        'access' => [
            'mode' => 'public',
        ],
    ],
],
```

- `/` renders the landing page of the default version directly. Other URLs without a version redirect into the default version.
- Your own routes win. LaRecipe registers its routes after your app's, and a root-mounted set after every other set, so `/newsletter` on this site still reaches the app's own route. A docs page whose path matches one of your routes cannot be reached, so keep the paths apart.
- Remove Laravel's default `/` welcome route from `routes/web.php`, or it will answer instead of your docs.
- The catch-all leaves `/larecipe-assets/` and `/.well-known/` alone.

**Routes, domains and middleware**

`route.domain` pins a set to one domain: a set with `'domain' => 'docs.example.com'` answers only on that host, and its MCP endpoint does too. `route.middleware` is the middleware group around every docs route (`['web']`).

Every docs URL hangs off the prefix: pages, their `.md` twins, `llms.txt`, `skill.md`, `sitemap.xml`, assets and the MCP endpoint. All of them run through the middleware group except the MCP endpoint, so MCP clients can post without a session or CSRF token.

**The two sources**

- `repository` (the default, recommended): Markdown files in your repo, at `source.path` (`base_path('docs')`). Changes ride in your pull requests as ordinary files. See [the repository source](https://larecipe.saleem.dev/3.x/sources/repository.md).
- `database`: pages in your database, always behind a cache. It also takes `source.connection`, `source.cache` (a persistent store) and `source.disk` (for assets). Changes made in a pull request ship as [docs migrations](https://larecipe.saleem.dev/3.x/sources/docs-migrations.md). See [the database source](https://larecipe.saleem.dev/3.x/sources/database.md).

A set has one driver for all its versions and languages, and you can [switch](https://larecipe.saleem.dev/3.x/sources/switching.md) later.

**Override a default for one set**

Most keys outside `sets` are defaults for every set. A set overrides one by repeating it in its own entry. Its values merge over the top-level ones key by key, so you only write what differs:

```php title="config/larecipe.php"
'sets' => [
    'handbook' => [
        // route, source, access...
        'review' => 'auto',
        'search' => ['driver' => 'server'],
        'ai' => ['ask' => ['enabled' => true]],
        'agents' => ['llms_full' => false],
    ],
],
```

The [configuration reference](https://larecipe.saleem.dev/3.x/reference/configuration.md) says, key by key, which ones a set may override.

## Next

- [Project structure](https://larecipe.saleem.dev/3.x/get-started/project-structure.md): what lives in the docs folder.
- [Configuration reference](https://larecipe.saleem.dev/3.x/reference/configuration.md): every key, with its type and default.
- [Gate blocks and private docs](https://larecipe.saleem.dev/3.x/writing/gate-blocks.md): access modes and gates in full.
