Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message
Eloquent Schema

Eloquent Schema Laravel Package

visualbuilder/eloquent-schema

Adds MCP tools for Laravel Boost to introspect Eloquent models. Automatically discovers app and vendor models, extracts columns, relationships, and accessors, and serves complete model schemas with caching—helping AI assistants and dev tools generate accurate queries and code faster.

View on GitHub
Deep Wiki
Context7

Eloquent model schema discovery service with MCP tools for Laravel applications

Frequently asked questions about Eloquent Schema
How do I install Eloquent Schema in a Laravel 12 project?
Run `composer require visualbuilder/eloquent-schema` and publish the config with `php artisan vendor:publish --tag=eloquent-schema-config`. No additional setup is needed for basic schema discovery.
Does this package work with Laravel 11 or 12 only?
Yes, it’s designed for Laravel 11/12 with PHP 8.2+. It leverages Laravel’s service container and MCP ecosystem, so it won’t work on older versions without modifications.
Can I use this without Laravel Boost or MCP tools?
Absolutely. The core schema discovery and extraction services work independently. MCP tools (like `list-models`) require Laravel Boost, but you can access schemas programmatically via `ModelDiscoveryService`.
How does schema caching work, and when should I clear it?
Schemas are cached for a configurable TTL (default: 1 hour). Clear the cache manually with `php artisan eloquent-schema:clear` after model changes or automate it via post-migration hooks. Avoid disabling caching for large apps.
Will this break existing Eloquent models or migrations?
No, the package uses reflection and introspection—it never modifies your models or migrations. Schema extraction is non-intrusive and won’t interfere with existing functionality.
Can I exclude specific vendor packages (e.g., Spatie) from discovery?
Yes, use the `excluded_models` config array to blacklist specific classes or exclude entire vendor packages. Alternatively, whitelist packages in `included_packages` to reduce noise.
What’s the performance impact of deep relationship introspection?
Default `max_depth=2` balances speed and completeness. Depth >3 can consume significant memory. For large apps, start with shallow discovery and incrementally increase depth if needed.
How do I integrate this with a custom AI assistant or LLM?
Use the `ModelSchemaService` to fetch schemas programmatically or expose them via MCP tools if using Laravel Boost. For LLMs, pass the cached JSON schema to reduce token usage and improve query accuracy.
Are there alternatives for schema introspection in Laravel?
Manual tools like `php artisan model:schema` or packages like `spatie/laravel-model-stats` exist, but they lack MCP integration and vendor package support. This package is optimized for AI tooling and Laravel Boost ecosystems.
How do I test schema discovery in a CI pipeline?
Run `php artisan eloquent-schema:discover` in CI to validate model discovery. For MCP tools, test with `php artisan mcp:list-models`. Cache invalidation can be tested by toggling `cache_ttl` to 0 in config.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
terminal42/code-quality-tools
codifyo/ts-generator-bundle
testo/fiber
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor