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
Acquaint Softtech logo

Acquaint Softtech

Acquaint Softtech offers AI-ready Laravel developers who onboard in 48 hours at $3000/Month with no lengthy sales process and a 100 percent money-back guarantee.

Acquaint Softtech
Shift logo

Shift

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

Shift
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
Kirschbaum logo

Kirschbaum

Providing innovation and stability to ensure your web application succeeds.

Kirschbaum
Securing Laravel logo

Securing Laravel

The essential security resource for Laravel devs, covering everything you need to keep your apps secure. Sign up to receive weekly security tips and monthly in depth articles, diving deep into security concepts you need to know!

Securing Laravel
Harpoon: Next generation time tracking and invoicing logo

Harpoon: Next generation time tracking and invoicing

The next generation time-tracking and billing software that helps your agency plan and forecast a profitable future.

Harpoon: Next generation time tracking and invoicing