Installation
Install the package with Composer:
bash
composer require --dev larswiegers/laravel-ai-evaluationThe service provider is auto-discovered by Laravel.
Install package defaults
Publish config and ensure the default eval directory exists:
bash
php artisan ai-evals:installNext step
Generate your first eval file:
bash
php artisan make:ai-evals refund-policy --type=pestOr standalone:
bash
php artisan make:ai-evals refund-policy --type=standaloneDefault test case (Pest)
Make sure your tests/Pest.php includes AgentEvals so Pest discovers generated eval tests:
php
<?php
declare(strict_types=1);
use Tests\TestCase;
pest()->extend(TestCase::class)
->in('Feature', 'AgentEvals');If you use a custom base test case, replace Tests\TestCase with your project test case class.
Optional: publish config
If you want to customize defaults (format, retries, summary, judge agent), publish the config file:
bash
php artisan vendor:publish --tag=laravel-ai-evaluation-configThis creates:
text
config/laravel-ai-evaluation.php