spatie/laravel-model-info
Inspect Laravel Eloquent models to discover their file name, table name, attributes (name/type) and relations (name/type/related model). Also includes a ModelFinder to automatically locate all models in your application.
Adopt When:
Look Elsewhere If:
For Executives: *"This package lets us automate model metadata access in Laravel, cutting time spent manually auditing schemas by ~30%. It’s a lightweight, MIT-licensed tool that enables:
For Engineering:
*"Spatie’s laravel-model-info gives us programmatic access to model attributes, relations, and table names at runtime. Key wins:
dd() debugging: Get model structure via $modelInfo->attributes->whereType('string') instead of grepping files.User have a name field?’) in pipelines.BelongsTo relations for this model’).
Downside: Runtime reflection adds ~5ms/model (negligible for most apps). Tradeoff: zero maintenance vs. custom solutions."*How can I help you explore Laravel packages today?