PHPackages                             veeqtoh/prompt-deck - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. veeqtoh/prompt-deck

Abandoned → [promptphp/deck](/?search=promptphp%2Fdeck)Library[Utility &amp; Helpers](/categories/utility)

veeqtoh/prompt-deck
===================

Deck is a Laravel and PHP package for versioned, file-based AI prompt management with variable interpolation, performance tracking, A/B testing, and optional Laravel AI SDK integration.

v0.4.6(1w ago)1049.7k3MITPHPPHP ^8.2CI passing

Since Mar 4Pushed 1w ago1 watchersCompare

[ Source](https://github.com/promptphp/deck)[ Packagist](https://packagist.org/packages/veeqtoh/prompt-deck)[ Docs](https://github.com/promptphp/deck)[ Fund](https://www.paypal.com/paypalme/veeqtoh)[ GitHub Sponsors](https://github.com/veeqtoh)[ RSS](/packages/veeqtoh-prompt-deck/feed)WikiDiscussions 0.x Synced 1w ago

READMEChangelog (10)Dependencies (50)Versions (18)Used By (0)

[![Prompt Deck Logo](/docs/logo/banner.svg)](/docs/logo/banner.svg)

 [![Latest Version on Packagist](https://camo.githubusercontent.com/3883d23a09cc8f41f2ddad8c9511e3cd8131905b1876e491e8a29b5c53ef2f9a/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f70726f6d70747068702f6465636b3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/promptphp/deck) [![PHP from Packagist](https://camo.githubusercontent.com/90e1d1d86367185d51754b247eefe7f8577dc22fb32884c89997290d93be8102/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f70726f6d70747068702f6465636b3f7374796c653d666c61742d737175617265)](https://packagist.org/packages/promptphp/deck) [![GitHub license](https://camo.githubusercontent.com/316220e2d531ccdcae63bb32f825b0a7c3ecad20e62b5338cbbdd6dc37bfe784/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f70726f6d70747068702f6465636b3f7374796c653d666c61742d737175617265)](https://github.com/promptphp/deck/blob/0.x/LICENSE) [![Total Downloads on Packagist across promptphp/deck and veeqtoh/prompt-deck](https://camo.githubusercontent.com/a25fbbacbd4a0d57a876603b7b86d02e03157ad01fa3db95526d800d0bd8cf52/68747470733a2f2f696d672e736869656c64732e696f2f656e64706f696e743f75726c3d68747470732533412532462532467261772e67697468756275736572636f6e74656e742e636f6d25324670726f6d70747068702532466465636b253246626164676573253246646f776e6c6f6164732e6a736f6e267374796c653d666c61742d737175617265)](https://packagist.org/packages/promptphp/deck) [![Featured in Laravel News](https://camo.githubusercontent.com/1c1d699e17124bfe9da504b23f4612249aaefca82f52cb3fb251116edd25f677/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4665617475726564253230696e2532304c61726176656c2532304e6577732d4639333232433f7374796c653d666c61742d737175617265266c6f676f3d6c61726176656c266c6f676f436f6c6f723d7768697465)](https://laravel-news.com/prompt-deck-manage-ai-prompts-as-versioned-files-in-laravel/)

Introduction
------------

[](#introduction)

Deck, formerly Prompt Deck, provides AI prompt management for Laravel and PHP.

Organise your AI agent instructions as versioned files, compare prompt performance, and activate the right version across your app with variable interpolation, tracking, A/B testing, and Laravel AI SDK integration.

Important

Prompt Deck is now **Deck by PromptPHP**.

From `v0.4.0`, the package moved from `veeqtoh/prompt-deck` to `promptphp/deck`, and the namespace changed from `Veeqtoh\PromptDeck` to `PromptPHP\Deck`.

Upgrading from `v0.3.x`? See the [upgrade guide](UPGRADE.md).

Quick Start
-----------

[](#quick-start)

### Installation

[](#installation)

```
composer require promptphp/deck
```

Publish the config and migrations

```
php artisan vendor:publish --provider="PromptPHP\Deck\Providers\DeckServiceProvider"

# Run migrations.
php artisan migrate
```

### Creating a Prompt

[](#creating-a-prompt)

Use the Artisan command to create a versioned prompt

```
php artisan make:prompt order-summary
```

This creates the following structure

```
resources/prompts/order-summary/
├── metadata.json          # Prompt-level: name, description, roles, active version
└── v1/
    ├── metadata.json      # This version's own metadata
    └── system.md
```

Pass `--user` to add a user prompt, or `--role=` for any other role

```
php artisan make:prompt order-summary --user --role=assistant
```

```
resources/prompts/order-summary/
├── metadata.json
└── v1/
    ├── metadata.json
    ├── system.md
    ├── user.md
    └── assistant.md
```

Edit `resources/prompts/order-summary/v1/system.md` with your prompt content. Use `{{ $variable }}` syntax for dynamic values:

```
You are a {{ $tone }} customer service agent.
Summarise the following order for the customer: {{ $order }}.
```

### Using a Prompt

[](#using-a-prompt)

Load and render prompts with the `Deck` facade

```
use PromptPHP\Deck\Facades\Deck;

// Load the active version of a prompt.
$prompt = Deck::get('order-summary');

// Render a role with variables.
$prompt->system(['tone' => 'friendly', 'order' => $orderDetails]);
// "You are a friendly customer service agent. Summarise the following order..."

// Build a messages array ready for any chat-completion API.
$messages = $prompt->toMessages(['tone' => 'friendly', 'order' => $orderDetails]);
// [['role' => 'system', 'content' => '...']]
```

### Versioning

[](#versioning)

Run the command again on an existing prompt and Deck offers to create the next version or overwrite the current one

```
php artisan make:prompt order-summary

# Prompt [order-summary] already exists at version 1.
# What would you like to do?
#   [version  ] Create a new version (v2)
#   [overwrite] Overwrite version 1
```

Creating a version never changes which one your application serves, so you can draft freely in production

```
resources/prompts/order-summary/
├── metadata.json          # "active_version": 1
├── v1/                    # live: what Deck::get('order-summary') returns
│   ├── metadata.json
│   └── system.md
└── v2/                    # drafted, not serving traffic yet
    ├── metadata.json
    └── system.md
```

Check which version is live at any time

```
php artisan prompt:list --all
```

```
+---------------------+----------------+--------+------------------------------------------------------+
| Prompt              | Active Version | Active | Description                                          |
+---------------------+----------------+--------+------------------------------------------------------+
| order-summary       | v1             | ✅     | Summarises an order for the customer who placed it.  |
| order-summary       | v2             |        | Summarises an order for the customer who placed it.  |
+---------------------+----------------+--------+------------------------------------------------------+
```

Promote the new version when you are ready

```
php artisan prompt:activate order-summary v2

# or

php artisan prompt:activate order-summary 2
```

The `active_version` key in the prompt's root `metadata.json` flips to `2`, and every `Deck::get('order-summary')` call starts returning v2. Roll back by activating v1 again.

Both formats work programmatically too

```
// Load a specific version.
$prompt = Deck::get('order-summary', 'v2');

// Promote a version.
Deck::activate('order-summary', 'v2');
Deck::activate('order-summary', 2);
```

### Laravel AI SDK Integration

[](#laravel-ai-sdk-integration)

If you use the [Laravel AI SDK](https://laravel.com/docs/ai-sdk), add the `HasPromptTemplate` trait to your agents. This way, you do not need to define the `instructions()` method as it is provided automatically.

```
use PromptPHP\Deck\Concerns\HasPromptTemplate;

class OrderAgent extends Agent
{
    use HasPromptTemplate;

    // instructions() and promptMessages() are provided automatically.
}
```

Running `make:agent` will also auto-scaffold a matching prompt directory.

For the complete guide, see the [full documentation](#documentation) below.

---

Documentation
-------------

[](#documentation)

Full documentation can be found at  or the [docs](docs/) directory on GitHub.

Contributing
------------

[](#contributing)

Thank you for considering contributing to Deck by PromptPHP. Please open an issue or submit a pull request on [GitHub](https://github.com/promptphp/deck).

Code of Conduct
---------------

[](#code-of-conduct)

We follow the Laravel [Code of Conduct](https://laravel.com/docs/contributions#code-of-conduct). We expect you to abide by these guidelines as well.

Security Vulnerabilities
------------------------

[](#security-vulnerabilities)

If you discover a security vulnerability within Deck by PromptPHP, please email Victor Ukam at [victorjohnukam@gmail.com](victorjohnukam@gmail.com). All security vulnerabilities will be addressed promptly.

License
-------

[](#license)

Deck by PromptPHP is open-sourced software licensed under the [MIT license](LICENSE).

Support
-------

[](#support)

This library is created by [Victor Ukam](https://victorukam.com) with contributions from the [Open Source Community](https://github.com/promptphp/deck/graphs/contributors). If you've found this package useful, please consider [sponsoring this project](https://github.com/sponsors/veeqtoh). It will go a long way to help with maintenance.

###  Health Score

52

—

FairBetter than 96% of packages

Maintenance98

Actively maintained with recent releases

Popularity41

Moderate usage in the ecosystem

Community12

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 89.1% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~9 days

Recently: every ~2 days

Total

17

Last Release

12d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/19429315?v=4)[Victor Ukam](/maintainers/veeqtoh)[@veeqtoh](https://github.com/veeqtoh)

---

Top Contributors

[![veeqtoh](https://avatars.githubusercontent.com/u/19429315?v=4)](https://github.com/veeqtoh "veeqtoh (49 commits)")[![mintlify[bot]](https://avatars.githubusercontent.com/in/222410?v=4)](https://github.com/mintlify[bot] "mintlify[bot] (5 commits)")[![elliot-putt-spectre](https://avatars.githubusercontent.com/u/206565393?v=4)](https://github.com/elliot-putt-spectre "elliot-putt-spectre (1 commits)")

---

Tags

ailaravel-ailaravel-ai-sdklarvelphppromptprompt-engineeringprompt-versionprompt-version-controlprompt-versioningprompt-versioning-toollaravelaiab-testingpromptsperformance-trackingprompt-managementversioned-promptsfile-based-promptsvariable-interpolationpromptphp

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/veeqtoh-prompt-deck/health.svg)

```
[![Health](https://phpackages.com/badges/veeqtoh-prompt-deck/health.svg)](https://phpackages.com/packages/veeqtoh-prompt-deck)
```

###  Alternatives

[promptphp/deck

Deck is a Laravel and PHP package for versioned, file-based AI prompt management with variable interpolation, performance tracking, A/B testing, and optional Laravel AI SDK integration.

1005.8k](/packages/promptphp-deck)[psalm/plugin-laravel

Psalm plugin for Laravel

3345.4M354](/packages/psalm-plugin-laravel)[laravel/ai

The official AI SDK for Laravel.

1.1k4.6M322](/packages/laravel-ai)[api-platform/laravel

API Platform support for Laravel

58190.1k21](/packages/api-platform-laravel)[mike-bronner/laravel-model-caching

Automatic caching for Eloquent models.

2.4k161.4k2](/packages/mike-bronner-laravel-model-caching)[pressbooks/pressbooks

Pressbooks is an open source book publishing tool built on a WordPress multisite platform. Pressbooks outputs books in multiple formats, including PDF, EPUB, web, and a variety of XML flavours, using a theming/templating system, driven by CSS.

45844.8k1](/packages/pressbooks-pressbooks)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
