PHPackages                             promptphp/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. promptphp/deck

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

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.

v0.4.2(1w ago)93257↑285.2%2MITPHPPHP ^8.2CI passing

Since Mar 4Pushed 1w agoCompare

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

READMEChangelog (7)Dependencies (10)Versions (10)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/master/LICENSE) [ ![Total Downloads on Packagist](https://camo.githubusercontent.com/3c889cd214c167a65b1bd2f91b9c9daf65c31a76e6caa0f28ef624979c510b7f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f76656571746f682f70726f6d70742d6465636b3f7374796c653d666c61742d737175617265) ](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
├── v1/
│   ├── system.md
│   └── user.md
└── v2/
    ├── system.md
    └── user.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)

Create a new version of an existing prompt

```
php artisan make:prompt order-summary
# Automatically creates v2, v3, etc.
```

Activate a specific version

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

# or

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

Or load a specific version programmatically

```
$prompt = Deck::get('order-summary', 'v2');
```

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

47

—

FairBetter than 93% of packages

Maintenance98

Actively maintained with recent releases

Popularity30

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity42

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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 ~10 days

Recently: every ~2 days

Total

9

Last Release

13d 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 (42 commits)")

---

Tags

ailarvelphppromptprompt-engineeringlaravelailaravel-packagelaravel-aiab-testingpromptsdeckperformance-trackingprompt-managementversioned-promptsfile-based-promptsvariable-interpolationpromptphpprompt-deck

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

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

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

###  Alternatives

[psalm/plugin-laravel

Psalm plugin for Laravel

3325.1M337](/packages/psalm-plugin-laravel)[larastan/larastan

Larastan - Discover bugs in your code without running it. A phpstan/phpstan extension for Laravel

6.4k51.0M7.4k](/packages/larastan-larastan)[laravel/ai

The official AI SDK for Laravel.

9782.1M153](/packages/laravel-ai)[spatie/laravel-responsecache

Speed up a Laravel application by caching the entire response

2.8k8.7M64](/packages/spatie-laravel-responsecache)[ashallendesign/short-url

A Laravel package for creating shortened URLs for your web apps.

1.4k2.2M4](/packages/ashallendesign-short-url)[flarum/core

Delightfully simple forum software.

261.4M2.2k](/packages/flarum-core)

PHPackages © 2026

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