Prompt Deck by Victor Ukam gives Laravel applications a structured way to manage AI prompts — storing them as versioned markdown files on disk rather than embedding strings directly in application code.
The package requires PHP 8.2+ and Laravel 11+.
Key features:
- Disk-based prompt files with directory-based versioning
- Variable interpolation using
{{ $variable }}syntax in markdown files - Artisan commands for creating, listing, testing, and activating prompt versions
- A/B testing support to compare prompt versions by token usage, latency, and cost
- Integration with
laravel/aivia aHasPromptTemplatetrait
Creating and Using Prompts
After installing the package, you can generate a new prompt with the provided make:prompt command:
php artisan make:prompt order-summary
This scaffolds a versioned directory structure under resources/prompts/ that might look like this given the above command:
resources/prompts/└── order-summary/ ├── v1/ │ └── system.md └── metadata.json
You can then edit the system.md prompt file with {{ $variable }} placeholders for dynamic values:
You are a {{ $tone }} customer service agent.Summarise the following order: {{ $order }}.
Here's an example of how you can load/render the prompt:
use Veeqtoh\PromptDeck\Facades\PromptDeck; $prompt = PromptDeck::get('order-summary');$messages = $prompt->toMessages(['tone' => 'friendly', 'order' => $orderDetails]);
The toMessages() method returns a message array compatible with OpenAI, Anthropic, and similar API formats.
To load a specific version:
$prompt = PromptDeck::get('order-summary', 'v2');
You can also activate a version via Artisan without touching code:
php artisan prompt:activate order-summary v2
Laravel AI SDK Integration
For applications using laravel/ai, the HasPromptTemplate trait automatically provides instructions() and promptMessages() on your agent class:
use Veeqtoh\PromptDeck\Concerns\HasPromptTemplate; class OrderAgent extends Agent{ use HasPromptTemplate;}
When PROMPTDECK_SCAFFOLD_ON_MAKE_AGENT=true is set in .env, running php artisan make:agent will also scaffold a matching prompt directory automatically.
You can find Prompt Deck on GitHub and read the full documentation at the Prompt Deck docs.