lc:analyze-model

Analyze Laravel Eloquent models and migration files for architectural inconsistencies.

12|2|Updated Apr 8, 2026
One-click install
npx skills add https://github.com/edulazaro/laraclaude --skill lc-analyze-model
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: lc:analyze-model
Source: https://github.com/edulazaro/laraclaude/tree/main/skills/analyze-model
Command: npx skills add https://github.com/edulazaro/laraclaude --skill lc-analyze-model

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This skill addresses the complexity of maintaining large Laravel Eloquent models by identifying hidden architectural issues, missing relationships, and security risks like unfillable mass-assignment fields.

Core Features & Use Cases

  • Comprehensive Auditing: Scans models for traits, scopes, accessors, and observers to provide a complete structural overview.
  • Automated Remediation: Offers a fix mode to automatically generate missing fillable arrays, casts, and relationship methods based on migration data.
  • Use Case: When onboarding a new developer to a legacy codebase, use this skill to instantly visualize the relationship graph and identify missing foreign key constraints that could lead to data integrity issues.

Quick Start

Run the analyze model skill to perform a full audit and suggest fixes for the User model.

Frequently Asked Questions about lc:analyze-model

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I find missing fillable fields and incorrect casts in Laravel Eloquent models?

To find missing fillable fields and incorrect casts, analyze Laravel Eloquent models by cross-referencing model properties with migration files. This detects architectural inconsistencies and security risks like mass-assignment vulnerabilities, then executes automated refactoring to apply structural fixes.

What is the best way to audit a legacy Laravel codebase for orphaned relationships?

Auditing a legacy Laravel codebase for orphaned relationships involves scanning models for traits, scopes, accessors, and observers. This provides a complete structural overview and cross-references database schema definitions to identify missing foreign key constraints and data integrity issues.

Can I automatically generate missing Eloquent relationship methods from database migrations?

Yes, you can automatically generate missing Eloquent relationship methods from migrations. By parsing class metadata and migration data, automated remediation generates missing fillable arrays, casts, and relationship methods to ensure adherence to Laravel best practices.

How do I detect architectural inconsistencies between Laravel models and database schemas?

Detecting architectural inconsistencies between Laravel models and schemas requires parsing class metadata, relationships, and database schema definitions. Cross-referencing these elements identifies missing fillable fields, incorrect casts, and orphaned relationships across the codebase.

Does this Laravel code analysis tool require any external dependencies to run?

No, this Laravel code analysis tool requires no external dependencies to run. It operates independently to parse Eloquent models and migration files, performing cross-referencing and automated refactoring without needing additional packages.

What are the limitations of automated code refactoring for Eloquent models?

Automated code refactoring for Eloquent models focuses on structural fixes like fillable arrays, casts, and relationships based on migration data. It may not address complex business logic or custom accessors requiring manual review after applying structural fixes.