DEDUPED Hot AI repos, turned into use cases Get 5 a day

What you can do with 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.

Trended earlier

Third-party repos we don't own or vouch for. AI-generated use cases can be wrong: review everything and run at your own risk.

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.

How to use 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.

Laya PHP alternatives · Best AI repos for Work and operations

About this repo

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)
Maintain Laya PHP? Add the Featured on Deduped badge

Paste this into your README:

[![Featured on Deduped](https://dedupedai.com/badge/marcreichel-laya-php.svg)](https://dedupedai.com/use-cases/marcreichel-laya-php/?ref=badge)

More badge styles and HTML

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.

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: AI Job Search, Solidcraft, Fastbrowse, Awesome AI Agent Platforms, Nautilo.

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.