PHPackages                             lvlup-dev/laravel-agent-editable-prompts - 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. lvlup-dev/laravel-agent-editable-prompts

ActiveLaravel-package

lvlup-dev/laravel-agent-editable-prompts
========================================

Store agent prompts in the database, resolve concatenated text by agent slug, and ship optional Inertia + Vue CRUD pages.

v1.1.0(1mo ago)03↑2900%MITPHPPHP ^8.2

Since Mar 29Pushed 1mo agoCompare

[ Source](https://github.com/lvlup-dev/laravel-agent-editable-prompts)[ Packagist](https://packagist.org/packages/lvlup-dev/laravel-agent-editable-prompts)[ Docs](https://www.lvlup.fr)[ RSS](/packages/lvlup-dev-laravel-agent-editable-prompts/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (9)Versions (3)Used By (0)

Laravel Agent Editable Prompts
==============================

[](#laravel-agent-editable-prompts)

[![Latest Version on Packagist](https://camo.githubusercontent.com/a03f4e20374ddef626c966f464723cfdc8466085c22525aa71c665c005957dea/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c766c75702d6465762f6c61726176656c2d6167656e742d6564697461626c652d70726f6d7074732e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lvlup-dev/laravel-agent-editable-prompts)[![MIT Licensed](https://camo.githubusercontent.com/55c0218c8f8009f06ad4ddae837ddd05301481fcf0dff8e0ed9dadda8780713e/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c61742d737175617265)](LICENSE)

Store **LLM / agent prompts** in the database, group them by **`agent_slug`**, order them with **`priority`**, and resolve them at runtime as **ordered segments** or a **single concatenated string**. Optionally register an **Inertia + Vue** CRUD so non-developers can edit prompts without deploys.

**Requires [inertiajs/inertia-laravel](https://github.com/inertiajs/inertia-laravel)** (and a Vue/React frontend) if you use the bundled admin UI.

Quick example
-------------

[](#quick-example)

```
use LvlupDev\AgentEditablePrompts\Services\AgentPromptService;

// Single string: all rows for this slug, sorted by priority, joined with the configured separator
$instructions = app(AgentPromptService::class)->resolve('my-agent');

// Ordered Eloquent models (e.g. Blade::render per row in your app)
$chunks = app(AgentPromptService::class)->segments('my-agent');
```

Installation
------------

[](#installation)

### 1. Composer

[](#1-composer)

```
composer require lvlup-dev/laravel-agent-editable-prompts
```

Laravel **auto-discovers** `AgentEditablePromptsServiceProvider` (see `composer.json` → `extra.laravel.providers`).

### 2. Migrations

[](#2-migrations)

The package **loads its migration automatically**. Create the table:

```
php artisan migrate
```

Default table name: **`agent_editable_prompts`**. Override with `AGENT_EDITABLE_PROMPTS_TABLE` (see below) if needed.

### 3. Configuration (recommended)

[](#3-configuration-recommended)

Publish the config file so you can tune behaviour and `.env` overrides in one place:

```
php artisan vendor:publish --tag=agent-editable-prompts-config
```

This copies `config/agent-editable-prompts.php` into your application. Until you publish, merged defaults from the package still apply.

### 4. Inertia / Vue pages (if you use the bundled CRUD)

[](#4-inertia--vue-pages-if-you-use-the-bundled-crud)

The HTTP controllers render Inertia pages under **`Vendor/AgentPrompts/*`**. Those components **must exist** in your app (Vite only bundles your `resources/js` tree).

Publish the starter pages:

```
php artisan vendor:publish --tag=agent-prompts-vue
```

Then adapt them to your layout (e.g. wrap with your admin shell), run your frontend build, and ensure [Wayfinder](https://github.com/laravel/wayfinder) or your route helpers know the package routes if you link from the sidebar.

If you **do not** want the package routes at all, set `AGENT_EDITABLE_PROMPTS_REGISTER_ROUTES=false` and build your own controllers/UI while still using `AgentPrompt` + `AgentPromptService`.

### 5. Environment variables

[](#5-environment-variables)

All keys are optional; defaults match `config/agent-editable-prompts.php`.

VariableDefault (if unset)Role`AGENT_EDITABLE_PROMPTS_TABLE``agent_editable_prompts`Database table name.`AGENT_EDITABLE_PROMPTS_SEPARATOR``\n\n`Separator used by `AgentPromptService::resolve()`.`AGENT_EDITABLE_PROMPTS_PRIORITY_SORT``asc``asc` or `desc` — order of `priority` when resolving.`AGENT_EDITABLE_PROMPTS_REGISTER_ROUTES``true`Set to `false` to disable the Inertia CRUD routes entirely.`AGENT_EDITABLE_PROMPTS_MIDDLEWARE``web`Comma-separated middleware list for the CRUD routes. **Include `web`** when using Inertia (session, cookies, CSRF). Example: `web,auth` or `web,auth,admin`.`AGENT_EDITABLE_PROMPTS_ROUTE_PREFIX`*(empty)*URL prefix (no leading slash required; it is trimmed). Example: `admin` → `/admin/agent-editable-prompts`.`AGENT_EDITABLE_PROMPTS_ROUTE_NAME_PREFIX`*(empty)*Prepended to route names. Example: `admin.` → `admin.agent-editable-prompts.index`.**Important:** routes registered by the package are **not** defined in your `routes/web.php`; they only receive the middleware you list in `AGENT_EDITABLE_PROMPTS_MIDDLEWARE`. For a typical Inertia app, use at least **`web,auth`** (and your admin gate if you have one).

Usage
-----

[](#usage)

### Model

[](#model)

`LvlupDev\AgentEditablePrompts\Models\AgentPrompt` uses the configured table and fillable fields:

- `agent_slug` — logical agent (e.g. `support-bot`, `onboarding`)
- `name` — human label in the UI
- `content` — prompt body (your app may treat it as Blade, Markdown, etc.)
- `priority` — integer; lower values sort first when `priority_sort_direction` is `asc`

### Service

[](#service)

`AgentPromptService` is registered as a **singleton**:

```
$service = app(\LvlupDev\AgentEditablePrompts\Services\AgentPromptService::class);

$service->segments('my-agent'); // Collection of AgentPrompt models
$service->resolve('my-agent');  // string
```

### HTTP routes (when enabled)

[](#http-routes-when-enabled)

Resource basename: **`agent-editable-prompts`**.
Route parameter name: **`agent_prompt`**.

Default route names (no `AGENT_EDITABLE_PROMPTS_ROUTE_NAME_PREFIX`):

- `agent-editable-prompts.index`
- `agent-editable-prompts.create`
- `agent-editable-prompts.store`
- `agent-editable-prompts.edit`
- `agent-editable-prompts.update`
- `agent-editable-prompts.destroy`

`AgentPromptService::routeName('index')` respects the configured name prefix.

Scope and alternatives
----------------------

[](#scope-and-alternatives)

**This package is intentionally focused:** one table, slug + priority, optional generic CRUD. It does **not** ship authorization policies, prompt versioning, A/B testing, or provider-specific prompt formats.

For richer CMS-style content or team workflows, consider integrating a headless CMS, a dedicated prompts product, or your own tables and UI on top of the same ideas.

Credits
-------

[](#credits)

**laravel-agent-editable-prompts** is built and maintained by [LVLUP](https://www.lvlup.fr). We help businesses drive operational efficiency through strategic consulting, tailored software development, and advanced AI agent integrations.

License
-------

[](#license)

The MIT License (MIT). Please see [LICENSE](LICENSE) for more information.

###  Health Score

39

—

LowBetter than 86% of packages

Maintenance90

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity47

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 ~0 days

Total

2

Last Release

46d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/91f10f8dfd1c4cad561f5c61e01b91f0820c2d08e9c67c8d092b8613bf40752b?d=identicon)[dsampaolo](/maintainers/dsampaolo)

---

Top Contributors

[![dsampaolo](https://avatars.githubusercontent.com/u/1384803?v=4)](https://github.com/dsampaolo "dsampaolo (2 commits)")

---

Tags

laravelaiAgentinertiavueprompts

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/lvlup-dev-laravel-agent-editable-prompts/health.svg)

```
[![Health](https://phpackages.com/badges/lvlup-dev-laravel-agent-editable-prompts/health.svg)](https://phpackages.com/packages/lvlup-dev-laravel-agent-editable-prompts)
```

###  Alternatives

[laravel/cashier

Laravel Cashier provides an expressive, fluent interface to Stripe's subscription billing services.

2.5k25.9M107](/packages/laravel-cashier)[laravel/pulse

Laravel Pulse is a real-time application performance monitoring tool and dashboard for your Laravel application.

1.7k12.1M99](/packages/laravel-pulse)[roots/acorn

Framework for Roots WordPress projects built with Laravel components.

9682.1M97](/packages/roots-acorn)[psalm/plugin-laravel

Psalm plugin for Laravel

3274.9M308](/packages/psalm-plugin-laravel)[laravel/cashier-paddle

Cashier Paddle provides an expressive, fluent interface to Paddle's subscription billing services.

264778.4k3](/packages/laravel-cashier-paddle)[api-platform/laravel

API Platform support for Laravel

59126.4k6](/packages/api-platform-laravel)

PHPackages © 2026

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