PHPackages                             christyoga123/db-structure-viewer - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Database &amp; ORM](/categories/database)
4. /
5. christyoga123/db-structure-viewer

ActiveLibrary[Database &amp; ORM](/categories/database)

christyoga123/db-structure-viewer
=================================

Laravel package to view database structure and related migrations

1.2.0(6mo ago)018PHPPHP ^8.1

Since Oct 13Pushed 6mo agoCompare

[ Source](https://github.com/ChristYoga123/db-struct-viewer)[ Packagist](https://packagist.org/packages/christyoga123/db-structure-viewer)[ RSS](/packages/christyoga123-db-structure-viewer/feed)WikiDiscussions main Synced 1mo ago

READMEChangelogDependencies (2)Versions (4)Used By (0)

DB Structure Viewer (Laravel)
=============================

[](#db-structure-viewer-laravel)

A lightweight Laravel console tool to inspect your database schema from the terminal. It shows columns and indexes for one or all tables, and can help you find related migration files.

Requirements
------------

[](#requirements)

- PHP &gt;= 8.1
- Laravel 10, 11, or 12
- MySQL/MariaDB (uses `information_schema`, `SHOW COLUMNS`, and `SHOW INDEXES`)

Installation
------------

[](#installation)

```
composer require christyoga123/db-structure-viewer --dev
```

The service provider is auto-discovered; no manual registration is required.

Command Overview
----------------

[](#command-overview)

```
php artisan db:structure {table?} {--all} {--list} {--migrations}

```

- `table?` (optional): Show structure for the given table
- `--all`: Show structure for every table
- `--list`: List all tables in the current database
- `--migrations`: Try to locate related migration files for the selected table(s)
- `-v|--verbose`: Also print full file paths for related migrations

If no arguments/options are provided, an interactive prompt will guide you.

Usage
-----

[](#usage)

### List all tables

[](#list-all-tables)

```
php artisan db:structure --list
```

### Show a specific table

[](#show-a-specific-table)

```
php artisan db:structure users
```

### Show a specific table and related migrations

[](#show-a-specific-table-and-related-migrations)

```
php artisan db:structure users --migrations
```

### Show all tables

[](#show-all-tables)

```
php artisan db:structure --all
```

### Show all tables and related migrations

[](#show-all-tables-and-related-migrations)

```
php artisan db:structure --all --migrations
```

### Interactive mode

[](#interactive-mode)

Simply run without args and choose from the menu:

```
php artisan db:structure
```

What you’ll see
---------------

[](#what-youll-see)

For each table:

- Columns: name, type, nullability, key, default, extra
- Indexes: name, column, uniqueness, type
- (Optional) Related migration files, with an inferred type such as "Create Table", "Add Column(s)", etc. Use `-v` to include full file paths and optionally print file contents on confirmation.

How migrations are detected
---------------------------

[](#how-migrations-are-detected)

The command scans `database/migrations` and matches common filename patterns that include the table name (plural and singular variations), such as:

- `create_{table}_table`
- `*_to_{table}_table`
- `*_in_{table}_table`
- `*_{table}_*`

Notes and limitations
---------------------

[](#notes-and-limitations)

- Currently tailored for MySQL/MariaDB dialects via `information_schema`, `SHOW COLUMNS`, and `SHOW INDEXES`.
- Migration detection is filename- and simple content-based and may not catch every edge case.

Troubleshooting
---------------

[](#troubleshooting)

- Ensure your `.env` database connection points to the intended schema.
- Make sure tables exist and your DB user has access to `information_schema`.
- For large schemas, consider using `table` or `--list` first to scope output.

License
-------

[](#license)

This package is open source software. If a `LICENSE` file is not present, please open an issue to clarify licensing terms.

###  Health Score

34

—

LowBetter than 77% of packages

Maintenance67

Regular maintenance activity

Popularity8

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~8 days

Total

3

Last Release

193d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/b01c6d4bb784d243e2c31c0e28d6bcc0c668cc2bc415e6d64a087c365442b86a?d=identicon)[ChristYoga123](/maintainers/ChristYoga123)

---

Top Contributors

[![ChristYoga123](https://avatars.githubusercontent.com/u/93587043?v=4)](https://github.com/ChristYoga123 "ChristYoga123 (3 commits)")

### Embed Badge

![Health badge](/badges/christyoga123-db-structure-viewer/health.svg)

```
[![Health](https://phpackages.com/badges/christyoga123-db-structure-viewer/health.svg)](https://phpackages.com/packages/christyoga123-db-structure-viewer)
```

###  Alternatives

[spatie/laravel-backup

A Laravel package to backup your application

6.0k21.8M190](/packages/spatie-laravel-backup)[tucker-eric/eloquentfilter

An Eloquent way to filter Eloquent Models

1.8k4.8M26](/packages/tucker-eric-eloquentfilter)[laravel-doctrine/orm

An integration library for Laravel and Doctrine ORM

8425.3M87](/packages/laravel-doctrine-orm)[ryangjchandler/orbit

A flat-file database driver for Eloquent.

922256.2k5](/packages/ryangjchandler-orbit)[clickbar/laravel-magellan

This package provides functionality for working with the postgis extension in Laravel.

423715.4k1](/packages/clickbar-laravel-magellan)[cybercog/laravel-clickhouse

ClickHouse migrations for Laravel

163166.8k](/packages/cybercog-laravel-clickhouse)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
