Polyscope - The agent-first dev environment for Laravel

Prompt

Prompt stats

Downloads
2
Stars
0
Open Issues
0
Forks
0

View on GitHub →

Manage AI prompts in Blade style.

Prompt

Prompt is a simple Laravel package for managing your AI prompts in Markdown files, with the full power of Blade.

Installation

You can install the package via composer:

composer require chimit/prompt

Usage

Create Your Prompts

Create your prompt files in the resources/prompts directory using the .md extension. You can organize them in subdirectories as needed:

resources/
└── prompts/
├── seo/
│ └── product-meta.md
└── welcome.md

Use Blade Syntax in Your Prompts

Your prompt files support full Blade syntax, including variables, PHP expressions, and unsafe HTML rendering. Here's an example resources/prompts/seo/product-meta.md:

You are an SEO expert specializing in e-commerce. Generate a compelling meta description for this product.
 
**Product:** {{ $product->name }}
**Price:** ${{ number_format($product->price, 2) }}
 
**Product Description:**
---
{!! $product->description !!}
---
 
@if($product->discount_percentage > 0)
**Special Offer:** {{ $product->discount_percentage }}% OFF - Limited Time!
@endif
 
Requirements:
- Maximum 160 characters
- Include the product name and key benefits
- Create urgency if there's a discount
- Target keywords: {{ implode(', ', $keywords) }}

Render Your Prompts

Use the Prompt::get() method to render your prompts with data, just like you would with Blade views:

use Chimit\Prompt;
 
$prompt = Prompt::get('seo/product-meta', [
'product' => $product,
'keywords' => ['wireless headphones', 'bluetooth', 'noise cancelling']
]);
Cube

Laravel Newsletter

Join 40k+ other developers and never miss out on new tips, tutorials, and more.


Chimit Prompt Related Articles

Manage AI Prompts in Your Laravel App with Markdown and Blade image

Manage AI Prompts in Your Laravel App with Markdown and Blade

Read article
Shift logo

Shift

Running an old Laravel version? Instant, automated Laravel upgrades and code modernization to keep your applications fresh.

Shift
LoadForge logo

LoadForge

Scalable load testing for web apps & APIs. Simulate real-world traffic and identify breaking points and performance limits with powerful, scalable load tests designed for Laravel.

LoadForge
CodeKudu logo

CodeKudu

Stand-ups, Retrospectives, and 360° Feedback for the entire team. 50% off with code LARAVELNEWS.

CodeKudu
Blastup logo

Blastup

Blastup provides social media enhancement services including buying Instagram likes, followers, and views, with features like instant delivery and a variety of packages to suit different needs.

Blastup
PhpStorm logo

PhpStorm

The go-to PHP IDE with extensive out-of-the-box support for Laravel and its ecosystem.

PhpStorm
Typesense Search logo

Typesense Search

Typesense is an open source, blazing-fast search engine, optimized for helping you build delightful search experiences for your sites and apps. Natively integrated with Laravel Scout.

Typesense Search