DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to use Laya PHP: what you can do with it

What is Laya PHP? A PHP SDK for classifying text with Laya, a self-hosted multilingual decision engine that returns typed enums, ints and bools without an LLM API bill.

How do I use it? Run composer require marcreichel/laya-php in your PHP project; then 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. Full steps below.

Trended earlier

View repo on GitHub

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer

4 use cases

  • Route support tickets by department, urgency and churn risk

    Send each incoming ticket to the right team on your own server, with a confidence check for human review.

    View 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.
  • Block abusive or spam text in Laravel form submissions

    Add a validation rule that asks a yes/no question about each submitted text and rejects the bad ones.

    View prompt
    In the marcreichel/laya-php repo's Laravel setup, add a Decides::not rule with the question <moderation question> to the <form field> validation in <controller or form request>. Report which test inputs pass and fail, and verify that a request with a fake answer of true is rejected.
  • Unit-test classification code without a running server

    Run your tests against a built-in fake so CI does not need Laya or Docker.

    View prompt
    In the marcreichel/laya-php repo, write a test for <class that calls Laya> that uses the built-in fake to return <expected answers>. Report the test result and the call count, and verify that the test passes with no laya-serve running.
  • Save typed decisions in an Eloquent JSON column

    Cast a model attribute to a decision class so the result reads back as a typed object.

    View prompt
    In the marcreichel/laya-php repo, add an AsDecision cast for <decision class> on the <model> model's <json column>. Save one decision, reload the model and report the stored JSON and the read-back enum value. Verify that assigning a non-decision value throws InvalidDecisionCastException.

Quick start with Laya PHP

  1. Check you have what it needs: 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.
  2. Open marcreichel/laya-php on GitHub and read the README and license.
  3. Run composer require marcreichel/laya-php in your PHP project.
  4. 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.
  5. 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.".
  6. In your queued job, call $laya->decide($ticket->body, Triage::class) and save the department on the ticket.

These steps come from our top use case, Route support tickets by department, urgency and churn risk, which also has a copy-paste agent prompt.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for marcreichel/laya-php

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Best AI repos for Work and operations

About this repo

  • Who it is forPHP and Laravel developers who need to route, score or flag text on their own server without per-token LLM fees.
  • Why it is hot109 stars, launched 44 days ago, picked up by one AI source we track
  • LanguagePHP
  • Sourcegithub.com/marcreichel/laya-php ยท Back to Hot repos

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)

Add this badge to your README

Maintain Laya PHP? Show readers where to find these use cases. Use cases on Deduped

Markdown

[![Use cases on Deduped](https://dedupedai.com/badge/marcreichel/laya-php.svg)](https://dedupedai.com/use-cases/marcreichel-laya-php/?utm_source=github&utm_medium=badge&utm_campaign=marcreichel-laya-php)

HTML

<a href="https://dedupedai.com/use-cases/marcreichel-laya-php/?utm_source=github&amp;utm_medium=badge&amp;utm_campaign=marcreichel-laya-php"><img src="https://dedupedai.com/badge/marcreichel/laya-php.svg" alt="Use cases on Deduped" height="20"></a>

A static image, no tracking script. About the badge

Questions about Laya PHP

What is Laya PHP?

A PHP SDK for classifying text with Laya, a self-hosted multilingual decision engine that returns typed enums, ints and bools without an LLM API bill. It is an open-source project on GitHub: https://github.com/marcreichel/laya-php.

How do I use Laya PHP?

Run composer require marcreichel/laya-php in your PHP project; then 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. The use cases on this page give the full steps and a copy-paste agent prompt for each job.

Who is Laya PHP for?

PHP and Laravel developers who need to route, score or flag text on their own server without per-token LLM fees.

What can I do with Laya PHP?

4 use cases so far, for example: Route support tickets by department, urgency and churn risk; Block abusive or spam text in Laravel form submissions; Unit-test classification code without a running server. Each has steps and a copy-paste agent prompt.

What do I need to run Laya PHP?

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).

What are alternatives to Laya PHP?

Other hot AI repos in Work and operations: Open Maus Bot, Career Ops, Paperclip, n8n Skills, Nocodb.

Is Laya PHP safe to run?

Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.