laravel/surveyor
Laravel Surveyor is a mostly static analysis tool for PHP/Laravel that scans files or classes to extract rich metadata (classes, methods, properties, types, bindings, models) in a structured format for other tools. Beta API; may touch DB for model inspection.
ArrayShapeType for Laravel collections) allows for fine-grained code introspection, useful for:
SURVEYOR_CACHE_ENABLED=true) to mitigate performance costs./api/code-analysis) for downstream tools.SURVEYOR_CACHE_DIR).composer require laravel/surveyor..env + AnalyzedCache::enableDiskCache().$analyzer->analyzeClass(\App\Models\User::class).ClassLikeResult methods).isModelRelation(), databaseAttributes().Type::from() for custom type checks.AnalyzedCache::clear()).AnalyzedCache::clearMemory()).eval, create_function). Document known limitations.try-catch if DB is optional.SURVEYOR_CACHE_DIR unavailability gracefully.| Failure Scenario | Impact | Mitigation |
|---|---|---|
| API Breaking Change | Downstream tools break. | Feature flags for unstable APIs. |
| Database Unavailable | Model analysis fails. | Disable model analysis or mock DB. |
| Cache Corruption | Stale/invalidated data. | Fallback to full analysis. |
| Memory Exhaustion | OOM crashes. | Limit analysis scope (e.g., exclude vendors). |
| False Negative in Analysis | Critical code issues missed. | Manual review for |
How can I help you explore Laravel packages today?