Skip to main content

Introduction

Deck by PromptPHP ships with sensible defaults that work out of the box. Like most Laravel packages, all configuration lives in config/deck.php and every option can be overridden via environment variables for deployment flexibility.

Publishing the configuration

Publish the configuration file using the Artisan command:
This copies the package’s default configuration to config/deck.php in your application. Once published, you can modify it freely.

Prompts path

The path option determines where your versioned prompt files are stored on disk:
By default, prompts live in resources/prompts/. You can change this to any directory:
The directory is created automatically when you first run php artisan make:prompt.

File extension

The extension option controls the file extension used for prompt template files:
Markdown (.md) is the default and recommended for readability. You can change it to any extension:
Changing the extension only affects newly generated files. Existing prompt files are not renamed automatically.

Versioning strategy

The versioning option controls how prompt versions are organised:
Currently, only the directory strategy is supported. Each version is stored in its own sub-directory (v1/, v2/, etc.) within the prompt’s folder:

Cache

The cache section controls prompt caching behaviour. Caching avoids repeated filesystem reads by storing loaded prompts in your configured cache store.

Enabling / disabling

By default, caching is disabled when APP_DEBUG=true (local development) and enabled in production. This ensures that file changes are picked up immediately during development. Override via your .env:

Cache store

The cache store to use. Must match a store name defined in your config/cache.php. Common values:

TTL

Cache time-to-live in seconds. After this duration, the prompt is re-read from disk on the next access. Default is 3600 seconds (1 hour).

Cache key prefix

The prefix prepended to all cache keys. The final cache key follows the pattern: {prefix}{name}.v{version}. For example, with the default prefix:

Database tracking

The tracking section controls whether prompt versions and executions are logged to the database.

Enabling / disabling

Like caching, tracking is disabled in debug mode and enabled in production by default. When enabled:
  • Version activation is stored in the prompt_versions database table (instead of metadata.json).
  • Execution tracking via Deck::track() inserts records into the prompt_executions table.
You must publish and run the migrations before enabling tracking. See Installation — Publishing migrations.

Database connection

The database connection to use for tracking tables. Set to null (the default) to use your application’s default connection. Set to a named connection from config/database.php if you want tracking data stored on a separate database:

AI SDK integration

When the Laravel AI SDK is installed and this option is true, Deck automatically creates a matching prompt directory whenever you run php artisan make:agent. See the AI SDK Integration documentation for details. Set to false to disable automatic scaffolding:

Full configuration reference

Environment variables reference