laranex/laravel-schema-viewer
laranex/laravel-schema-viewer lets you browse your Laravel database schema from a clean in-app interface, making it easy to inspect tables, columns, indexes, and relationships so you can understand and debug your data model faster.
composer require laranex/laravel-schema-viewer --dev. This is a developer-facing inspection tool; it has no business shipping to production.php artisan vendor:publish --tag="schema-viewer-config" (fall back to a plain php artisan vendor:publish and pick the package provider if the tag name has moved).php artisan schema:generate. This writes a JSON representation of your database to a configurable path (database/schema.json by default). It connects to the database at generation time only — the viewer itself reads the file./schema-viewer) and browse tables, columns, indexes, and foreign keys.php artisan migrate (or connect to a restored dump), run schema:generate, and read the table list and relationships before you write a single query. It is the fastest way to answer "what does this orders table actually look like, and what references it?"Where to look first: config/schema-viewer.php for enabled, path, middleware, and the snapshot file location; then the generated schema.json directly — it is plain, greppable JSON and often faster to query than the UI.
schema:generate to a composer script or custom app:setup command after migrate:fresh --seed so the snapshot is never stale on a fresh clone.database/schema.json into git and regenerate it in the same PR as your migration. Reviewers diff the JSON and see added columns, changed nullability, dropped indexes, and new foreign keys without mentally parsing every migration file. It catches the classic bug where foreignId('user_id')->constrained() silently didn't create the constraint you assumed.php artisan schema:generate
git diff --exit-code database/schema.json
A non-empty diff means someone changed the schema without committing the regenerated snapshot — or a migration didn't apply as intended on that driver.'middleware' => ['web', 'auth'] (or a specific gate) plus 'enabled' => env('SCHEMA_VIEWER_ENABLED', app()->isLocal()). Do both; the env switch protects you if middleware config drifts.php artisan db:show and db:table <name> are quicker for a single lookup in the terminal; the viewer wins for the relational, whole-schema picture. Use each for what it's good at.schema:generate after your last migration. Make that reflex.SCHEMA_VIEWER_ENABLED=false in production envs, keep the package in require-dev, and add auth middleware for shared/staging environments.path or middleware has no effect on a cached deploy until you run php artisan config:clear and route:clear.db:table <name> or grep the JSON directly.schema.json.*_id column has a matching foreign key, or feed it into a Mermaid ERD generator for docs.How can I help you explore Laravel packages today?