geanruca/laravel-coherence

A Laravel package for AI-based data coherence validation in you Eloquent Models

v1.0.1-alpha 2025-05-19 19:41 UTC

This package is auto-updated.

Last update: 2025-06-19 19:50:26 UTC


README

Laravel Coherence is a developer tool that uses AI (via Prism) to validate whether the attributes of your Eloquent models are logically coherent before they are saved. It's useful for catching absurd or invalid values early, especially in data-critical applications.

🚀 Features

  • 🔎 Coherence validation using LLMs (OpenAI, etc.)
  • 📚 Automatic or manual model description
  • 🧠 Dynamic prompt generation with model context
  • 🛑 Strict mode (throws exception) or safe mode (logs result)
  • 📋 Polymorphic logging of all coherence checks

📦 Installation

composer require geanruca/laravel-coherence