AI Decision System
Replayable, offline-verifiable records for AI-assisted go/no-go decisions: experiment promotions, typed model answers and human-approved actions.
翻譯準備中
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證正在載入完整 README。 以下為已儲存的摘錄。
Relate Eloquent models to other models — of any type — and control how strongly they relate. Each relation has a base score and a boost; their product, the relation's weight, orders the related models.
Relations are directed: Action can relate to Fastpace with a score of 1.0 and to Genre with 0.5, while Genre relates back to Action with a score of its own.
You can install the package via Composer:
The migration for the relatables table runs automatically. You may publish all of the package's resources at once:
Or, you may publish each resource individually:檢視完整 README ↗Relate Eloquent models to other models — of any type — and control how strongly they relate. Each relation has a base score and a boost; their product, the relation's weight, orders the related models.
Relations are directed: Action can relate to Fastpace with a score of 1.0 and to Genre with 0.5, while Genre relates back to Action with a score of its own.
You can install the package via Composer:
composer require foxws/laravel-relatable
The migration for the relatables table runs automatically. You may publish all of the package's resources at once:
php artisan vendor:publish --tag="relatable"
Or, you may publish each resource individually:
php artisan vendor:publish --tag="relatable-config"
php artisan vendor:publish --tag="relatable-migrations"
[!TIP] Let your AI agent do the hard parts. This package ships a Laravel Boost skill,
relatable-development, that teaches your agent how to install, configure and use Laravel Relatable. Install Boost and select the skill when prompted:composer require laravel/boost --dev php artisan boost:installAlready using Boost? Run
php artisan boost:update --discoverto pick up the skill. Then just ask, for example: "Relate my Video model to tags and order them by weight."
Add the InteractsWithRelated trait to each model that relates to others:
use Foxws\Relatable\Concerns\InteractsWithRelated;
use Illuminate\Database\Eloquent\Model;
class Tag extends Model
{
use InteractsWithRelated;
}
Then relate models, with an optional score and boost:
$action->attachRelated($fastpace, score: 1.0);
$action->attachRelated($genre, score: 0.5);
// Relations are directed. Relate both ways (Action → Genre and Genre → Action),
// with a lower score back.
$action->attachRelated($genre, score: 0.5, mutual: true, mutualScore: 0.25);
// Relate exactly these models, removing the rest.
$action->syncRelated([
$fastpace,
['model' => $genre, 'score' => 0.5, 'boost' => 2.0],
]);
$action->detachRelated($genre); // only Action → Genre
$action->detachRelated($genre, mutual: true); // and Genre → Action
$action->relates; // Collection of related models, highest weight first
$action->getRelates(Video::class); // only related videos
See the documentation for mutual relations, scoring, querying relations, and configuration.
Please see CHANGELOG for more information on what has changed recently.
Thank you for considering contributing to Laravel Relatable! Please review our contributing guide to get started.
Please review our security policy on how to report security vulnerabilities.
Inspired by spatie/laravel-relatable.
Laravel Relatable is open-sourced software licensed under the MIT license.