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

Laravel Model Explorer Laravel Package

onelearningcommunity/laravel-model-explorer

View on GitHub
Deep Wiki
Context7

Laravel Model Explorer

Latest Version on Packagist GitHub Tests Action Status Total Downloads

A developer tool for Laravel that gives you a browsable UI to explore your Eloquent models — their attributes, casts, relations, scopes, traits, and live data — without reading code.

Zero setup beyond Composer install. No vendor:publish, no frontend tooling required in your application.

Requirements

  • PHP 8.4+
  • Laravel 11, 12, or 13

Features

  • 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

composer require --dev onelearningcommunity/laravel-model-explorer

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.

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:

Gate::define('viewModelExplorer', function (User $user): bool {
    return $user->isAdmin();
});

To disable the explorer entirely regardless of the gate, set the environment variable:

MODEL_EXPLORER_ENABLED=false

Configuration

Publish the config file to customise behaviour:

php artisan vendor:publish --tag="model-explorer-config"
return [
    // Set to false to disable entirely (e.g. force off in production regardless of gate)
    'enabled' => env('MODEL_EXPLORER_ENABLED', true),

    // URL prefix for all Model Explorer routes
    'path' => env('MODEL_EXPLORER_PATH', '_model-explorer'),

    // Middleware applied to all routes ('web' is required)
    'middleware' => ['web'],

    // Directories scanned for Eloquent models (add more for DDD layouts, packages, etc.)
    // Keys are the root namespace, values are absolute directory paths.
    'model_paths' => [
        'App'             => app_path(),
        // 'Domain\\Billing' => base_path('src/Billing'),
    ],

    // Traits whose FQN begins with these prefixes will be hidden in the UI
    'excluded_trait_prefixes' => [
        'Illuminate\Database\Eloquent\Concerns\\',
        'Illuminate\Database\Eloquent\HasCollection',
        'Illuminate\Support\Traits\\',
    ],
];

Security

Laravel Model Explorer 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.

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.
jayeshmepani/jpl-moshier-ephemeris-php
elnasnato/laraliveui
labrodev/rest-sdk
sampaui/sampaui
babelqueue/php-sdk
facebook/capi-param-builder-php
babelqueue/symfony
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle