lvlup-dev/laravel-agent-editable-prompts
agent_slug and resolve them as ordered segments or concatenated strings aligns well with modular agent architectures.segments() method returns Eloquent models, allowing customization (e.g., rendering prompts with Blade or injecting dynamic data). The resolve() method supports configurable separators, accommodating varied prompt formats.agent_prompts table (columns: agent_slug, priority, content, is_active). Lightweight and non-intrusive.resolve() method’s concatenation behavior (e.g., separator handling) must align with agent requirements. Misconfiguration could lead to malformed prompts (e.g., missing newlines or invalid syntax).segments() could return large Eloquent collections. Caching resolved prompts (e.g., via Laravel Cache) may be needed.agent_slug uniqueness beyond database constraints. Custom validation may be required.{{ placeholders }} or Blade directives be handled?agent_slugs and prompts are anticipated? Will caching resolved prompts be necessary?inertiajs/inertia-laravel)agent_prompts) with minimal schema. Compatible with MySQL, PostgreSQL, SQLite.agent_slug candidates (e.g., customer-support-agent, fraud-detection).\LvlupDev\AgentEditablePrompts\Models\AgentPrompt::create([
'agent_slug' => 'my-agent',
'priority' => 1,
'content' => 'First part of the prompt...',
]);
resolve() and segments() in a non-critical agent workflow.// routes/web.php
Route::inertia('/prompts', 'Prompts/Index');
segments()).AgentPromptService binding to modify resolution logic (e.g., add caching).AgentPrompt model for additional fields (e.g., language, version).php artisan vendor:publish --tag=agent-prompts-views).resolve()/segments() in agent services.agent_slug).segments() with large datasets.agent_prompts table and query logs.agent_slug naming conventions.resolve() is O(n) for concatenation. For >100 prompts, consider:
Cache::remember()).cache_key column to invalidate selectively.agent_slug and priority for faster segments() queries.agent_slug to tenants (e.g., tenant_id.agent_slug) and filter queries.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| Missing/inactive prompts | Agent fails or uses stale prompts. | Default prompts or fallback logic in resolve(). |
| Database connection issues | Prompts unresolved. | Cache resolved prompts with stale-while-revalidate. |
| Inertia UI bugs (if adopted) | Non-developers blocked. | Feature flag UI; provide migration fallback. |
| Prompt content errors (e.g., syntax) | LLM failures. | Validate prompts on save (regex, LLM pre-check). |
| High-priority prompt conflicts | Unexpected prompt ordering. | Enforce unique priority per agent_slug or use created_at as tiebreaker. |
How can I help you explore Laravel packages today?