Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Prompt Deck Laravel Package

veeqtoh/prompt-deck

View on GitHub
Deep Wiki
Context7

title: "Introduction" description: "Deck by PromptPHP helps you organise your AI Agents instructions as structured, version-controlled files, making it easy to iterate, compare, and activate prompt versions across your Laravel / PHP application."

It provides variable interpolation, performance tracking, A/B testing, and optional seamless integration with the Laravel AI SDK.

Quick start

Get up and running with Deck in minutes.

<Card title="Installation guide" icon="rocket" href="/getting-started/installation" horizontal

Install, configure, and verify Deck in your Laravel project.

Quick usage

Creating a prompt

After installing (installation guide), use the Artisan command to create a versioned prompt:

php artisan make:prompt order-summary

This creates the following structure:

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

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

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

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

If you use the Laravel 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.

Key features

Explore the docs

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
ilhamsyabani/laravel-volt-starter
thethunderturner/filament-latex
ghostcompiler/laravel-querybuilder
webrek/laravel-telescope-mongodb
anousss007/blatui
zatona-eg/zatona-eg-api
cocosmos/filament-sticky-save-bar
patrickbussmann/oauth2-apple
3brs/enterprise-security-bundle
anousss007/vigilance
supportpal/eloquent-model
ardenexal/fhir-models
laravel-at/laravel-image-sanitize
romalytar/yammi-audit-log-laravel
ardenexal/fhir-validation
arshaviras/weather-widget
laravel-chronicle/core
sunchayn/nimbus
daikazu/eloquent-salesforce-objects
unseen-codes/chat