{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "marcreichel-laya-php--route-support-tickets",
 "repo": "marcreichel/laya-php",
 "repo_url": "https://github.com/marcreichel/laya-php",
 "repo_slug": "marcreichel-laya-php",
 "title": "Route support tickets by department, urgency and churn risk",
 "page_title": "How to route support tickets by department, urgency and churn risk with Laya PHP",
 "summary": "Send each incoming ticket to the right team on your own server, with a confidence check for human review.",
 "who": "A support lead or backend developer whose help desk needs every ticket sorted without sending customer text to a paid LLM API.",
 "problem": "Tickets arrive unsorted, and manual triage is slow. Sending customer text to a hosted LLM costs per token and leaves your infrastructure.",
 "outcome": "Each ticket gets a typed department, urgency and churn flag, and low-confidence answers are routed to a person.",
 "steps": [
  "Run `composer require marcreichel/laya-php` in your PHP project.",
  "Start the local server from a clone of this repo with `docker compose up -d --wait`, then check it with `php artisan laya:health` in a Laravel app.",
  "Write a readonly decision class with enum fields for department and urgency and a bool for churn, then try it with `php artisan laya:try \"App\\Decisions\\Triage\" \"Hi, we were billed twice for March. Refund it today or we cancel.\"`.",
  "In your queued job, call `$laya->decide($ticket->body, Triage::class)` and save the department on the ticket.",
  "Compare `answerConfidence` with a threshold you choose and send low-confidence tickets to a human queue."
 ],
 "agent_prompt": "Using the marcreichel/laya-php repo, add a readonly decision class for <ticket queue> with department, urgency and churn fields, and call Laya::decide on the ticket body. Report the typed result and its answerConfidence for a sample ticket, and verify that `php artisan laya:try` prints a hydrated value for that class.",
 "agents": [
  "any"
 ],
 "difficulty": "Intermediate",
 "time": "1 hour",
 "basis": "readme",
 "caveat": "The SDK targets laya-serve running upstream Laya v0.4.6, and the README says it has not been tested against the hosted Jev API.",
 "category": "Work and operations",
 "tags": [
  "Work and operations"
 ],
 "lang": "php",
 "requirements": [
  "PHP 8.4+ and Composer",
  "A PSR-18 HTTP client such as Guzzle or Symfony HttpClient",
  "Docker, to run laya-serve from the repo's compose.yaml",
  "Laravel 13+ for the Laravel steps (service provider, artisan commands, validation rule, cast)"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/marcreichel-laya-php/route-support-tickets/",
 "md": "https://dedupedai.com/use-cases/marcreichel-laya-php/route-support-tickets/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/marcreichel-laya-php--route-support-tickets.json",
 "api_version": "v1"
}
