Download the PHP package onelearningcommunity/laravel-model-explorer without Composer
On this page you can find all versions of the php package onelearningcommunity/laravel-model-explorer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download onelearningcommunity/laravel-model-explorer
More information about onelearningcommunity/laravel-model-explorer
Files in onelearningcommunity/laravel-model-explorer
Package laravel-model-explorer
Short Description A zero-config browser UI and MCP server for exploring your Eloquent models, relationships, scopes, and data.
License MIT
Homepage https://github.com/one-learning-community/laravel-model-explorer
Informations about the package laravel-model-explorer
Model Explorer for Laravel
A Laravel package that gives AI coding agents and developers a live, structural view of your Eloquent models — columns, relations, scopes, accessors, traits, and data — through an MCP server for agents and a browsable UI for humans. No source scanning, no stale context.
Zero setup beyond Composer install. No vendor:publish, no frontend tooling required in your application.
Requirements
- PHP 8.3+
- Laravel 11, 12, or 13
Features
- AI Model Introspection (MCP) — a local
laravel/mcpserver exposing five tools (list-models,inspect-model,find-model,model-source,model-neighbors) so Claude Code, Cursor, and other MCP clients get live model structure and trait-correct source, instead of grepping your app - Model list — searchable grid of all discovered Eloquent models
- Model detail — DB columns, casts, fillable/hidden/guarded, relations with type badges and foreign keys, scopes with source snippets, traits, and accessor snippets
- Record lookup — find any record by primary key or unique field; browse raw attributes, lazy-loaded accessor values, and expandable relations with drill-down navigation and breadcrumb trail
- Relationship graph — interactive force-directed SVG graph of all model relationships
Installation
The package auto-registers via Laravel's package discovery — no additional setup required.
Usage
Visit /_model-explorer in your application. In local environments, access is granted by default.
AI Model Introspection (MCP)
Model Explorer ships a local laravel/mcp server,
model-explorer, that lets AI coding agents introspect your Eloquent models without
scanning source. Register it in your AI client:
Tools: list-models, inspect-model (opt-in sections via include, including a
members section listing every method/property/constant with provenance, filterable
by kind or declaring file), find-model (filter by trait/extends/relatesTo/
hasColumn/definesMember), model-source (fetches any member's source by name,
not just scopes/relations/accessors), and model-neighbors (a model's depth-1 relation
neighborhood — defaults to incoming relations, "which models point at this one").
If you use Laravel Boost, boost:install copies this
package's Boost guidelines into your project so an already-connected agent is told the
server exists — it doesn't register the server itself, so the client config above is
still required either way.
The tools read live by default so an agent never sees stale structure mid-development.
Set MODEL_EXPLORER_MCP_CACHE=true to trade freshness for speed on very large model
sets, or MODEL_EXPLORER_MCP=false to disable the server entirely. To inspect models
outside your configured model_paths (e.g. a vendor package's model) by FQCN, set
MODEL_EXPLORER_MCP_ALLOW_UNDISCOVERED=true.
See the MCP guide for the full tool reference.
Authorization
Access is controlled by the viewModelExplorer gate, which defaults to allowing access in local environments only. Override it in your AuthServiceProvider to control access elsewhere:
To disable the explorer entirely regardless of the gate, set the environment variable:
Configuration
Publish the config file to customise behaviour:
Caching
For apps with many models, the filesystem scanning and reflection behind the model
list, detail, and graph views can be enabled for caching via MODEL_EXPLORER_CACHE=true.
Model detail pages auto-refresh when the model file changes; the model list and graph
are cached until the TTL expires or you clear them manually:
Security
Model Explorer for Laravel is intended for development use. The viewModelExplorer gate should prevent access in production environments.
All record reads are wrapped in a rolled-back transaction with Model::withoutEvents() to prevent accidental writes from observers or model events. Note that non-database side effects from accessor methods (HTTP calls, cache writes, queue pushes) are not prevented.
Changelog
Please see CHANGELOG for more information on what has changed recently.
License
The MIT License (MIT). Please see License File for more information.
All versions of laravel-model-explorer with dependencies
illuminate/contracts Version ^11.0||^12.0||^13.0
laravel/mcp Version ^0.8.2
spatie/laravel-model-info Version ^2.0
spatie/laravel-package-tools Version ^1.16