Download the PHP package visualbuilder/eloquent-schema without Composer
On this page you can find all versions of the php package visualbuilder/eloquent-schema. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download visualbuilder/eloquent-schema
More information about visualbuilder/eloquent-schema
Files in visualbuilder/eloquent-schema
Package eloquent-schema
Short Description Eloquent model schema discovery service with MCP tools for Laravel applications
License MIT
Informations about the package eloquent-schema
Eloquent Schema
Adds new MCP tools to Laravel Boost for Eloquent model introspection. Designed for AI assistants and development tools that need to understand your application's data structure.
Provides complete model schemas, relationships and accessors so AI assistants can generate more accurate Eloquent queries and code without needing to read through multiple model files. This reduces token usage, speeds up responses, and eliminates guesswork about your database structure.
Features
- MCP Tools - Expose model schemas to AI assistants via Laravel MCP
- Model Discovery - Automatically discover models in your app and configured vendor packages
- Schema Introspection - Extract columns, relationships, and accessors from models
- Caching - Built-in caching for performance
- Vendor Support - Include models from packages like Spatie Permission, Media Library, etc.
Requirements
- PHP 8.2+
- Laravel 11 or 12
- Laravel MCP package (optional, for MCP tools)
Installation
Publish the configuration file:
Configuration
MCP Tools
This package provides three MCP tools for AI assistants:
list-models
List all discoverable Eloquent models in the application.
Parameters:
filter(string, optional) - Filter models by name (case-insensitive partial match)include_vendor(boolean, default: false) - Include models from vendor packages
Example Response:
Note: Combine namespace + model name for the full class (e.g., App\Models\User). Vendor models include their full namespace. The vendor_models key is only present when vendor models exist.
model-schema
Get the complete schema for an Eloquent model including columns, relationships, and accessors.
Parameters:
model(string, required) - Fully qualified model class namemax_depth(integer, default: 2, max: 3) - Depth for relationship exploration
Example Response:
model-fields
Get a compact list of model columns and relationship names. Useful for building queries.
Parameters:
model(string, required) - Fully qualified model class name
Example Response:
Artisan Commands
List Models
Discover Vendor Packages
Interactively discover and select vendor packages with Eloquent models:
Cache Management
Testing MCP Tools from CLI
Test the eloquent-schema MCP tools directly from the command line:
Generic MCP Tools Command
List and call any registered MCP tool (works with Laravel Boost and custom tools):
Vendor Model Discovery
To include models from vendor packages:
-
Run the discovery command to find packages with models:
-
Select the packages you want to include
-
Add the suggested configuration to
config/eloquent-schema.php: - Warm the cache:
Deduplication
When your app extends a vendor model, the package intelligently prefers your app model:
App\Models\UserextendsSpatie\Permission\Models\User→ OnlyApp\Models\Useris included- Models with the same basename prefer the App version
Using with Laravel Boost
Add the tools to your config/boost.php:
Using with Custom MCP Server
If using a custom MCP server, register the tools in your server class:
Programmatic Usage
You can also use the services directly:
Caching
Caching improves performance when frequently querying model schemas:
Set cache TTL via environment variable:
Set to 0 to disable caching during active development.
License
MIT License. See LICENSE for details.
All versions of eloquent-schema with dependencies
illuminate/database Version ^11.0|^12.0
illuminate/support Version ^11.0|^12.0