Configuration Reference
Publish and customize the config file to tune the analyzer for your project.
$ php artisan vendor:publish --tag=model-analyzer-config
config/model-analyzer.php
<?php
return [
/*
|--------------------------------------------------------------------------
| Model Path
|--------------------------------------------------------------------------
| Directory where the analyzer looks for Eloquent models.
*/
'model_path' => app_path('Models'),
/*
|--------------------------------------------------------------------------
| Ignored Models
|--------------------------------------------------------------------------
| Fully-qualified class names to skip during analysis.
*/
'ignored_models' => [
// App\Models\BaseModel::class,
],
/*
|--------------------------------------------------------------------------
| Strict Mode
|--------------------------------------------------------------------------
| When true, warnings are also treated as errors (exit code 1).
*/
'strict' => false,
/*
|--------------------------------------------------------------------------
| Health Weights
|--------------------------------------------------------------------------
| Each category contributes to the total 100-point health score.
| Adjust weights to reflect what matters most in your project.
*/
'health_weights' => [
'inverse_relationships' => 30, // Every relationship has an inverse
'no_circular_deps' => 30, // No circular dependency chains
'column_existence' => 20, // FK columns exist in the DB
'foreign_key_indexes' => 10, // FK columns are indexed
'foreign_key_constraints'=> 10, // FK constraints are defined
],
/*
|--------------------------------------------------------------------------
| Output Format
|--------------------------------------------------------------------------
| Default output format: 'text' or 'json'.
*/
'default_format' => 'text',
];
Health Weights Breakdown
The health score is calculated from these five weighted categories (total = 100 points).
Inverse Relationships
30 pts
30%
No Circular Dependencies
30 pts
30%
Column Existence
20 pts
20%
Foreign Key Indexes
10 pts
10%
Foreign Key Constraints
10 pts
10%