PHPackages                             lucapellegrino/dbmyadmin - 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. lucapellegrino/dbmyadmin

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

lucapellegrino/dbmyadmin
========================

A phpMyAdmin-like database management interface for Filament 5

v1.0.8(3mo ago)08↓92.9%MITPHPPHP ^8.3

Since Apr 3Pushed 3mo agoCompare

[ Source](https://github.com/lucapellegrino-70/dbmyadmin)[ Packagist](https://packagist.org/packages/lucapellegrino/dbmyadmin)[ RSS](/packages/lucapellegrino-dbmyadmin/feed)WikiDiscussions main Synced today

READMEChangelogDependencies (5)Versions (10)Used By (0)

DbMyAdmin
=========

[](#dbmyadmin)

[![Latest Version on Packagist](https://camo.githubusercontent.com/9f24233e76543f485983b600f59e26c4aa364a98188d3eb0e8130be08780d9af/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f6c75636170656c6c656772696e6f2f64626d7961646d696e2e7376673f7374796c653d666c61742d737175617265)](https://packagist.org/packages/lucapellegrino/dbmyadmin)[![PHP](https://camo.githubusercontent.com/93e348ca0701e914576dc85151a30f4673a5f6a2ad3add2ac638a409f57a0241/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f5048502d382e332532422d626c75653f7374796c653d666c61742d737175617265)](https://www.php.net)[![Laravel](https://camo.githubusercontent.com/9571743c03865c9f4c2d4b453c9450ed06edb36148d859ce9dd35b5784c96cbb/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f4c61726176656c2d31322532422d7265643f7374796c653d666c61742d737175617265)](https://laravel.com)[![Filament](https://camo.githubusercontent.com/e04e1ff8f9cf521b5e6fdb9c20bf256f515178b87d14f2fab3213d5158c9b836/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f46696c616d656e742d352532422d6f72616e67653f7374796c653d666c61742d737175617265)](https://filamentphp.com)[![License](https://camo.githubusercontent.com/422db9fd40f5831c765cf6530b6750c081b696bd18d904cf89554df98c676277/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d677265656e3f7374796c653d666c61742d737175617265)](LICENSE)

A phpMyAdmin-like database management interface for [Filament 5](https://filamentphp.com). Browse tables, execute SQL queries, manage records, and modify table structure — directly inside your Filament admin panel.

**Supported databases:** MySQL / MariaDB · PostgreSQL · SQLite

---

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

[](#installation)

### 1. Install via Composer

[](#1-install-via-composer)

```
composer require lucapellegrino/dbmyadmin
```

### 2. Publish and run migrations

[](#2-publish-and-run-migrations)

```
php artisan vendor:publish --tag=dbmyadmin-migrations
php artisan migrate
```

This creates the `dbmyadmin_saved_queries` table used to persist your saved SQL queries.

### 3. Register the plugin in your Panel Provider

[](#3-register-the-plugin-in-your-panel-provider)

Open `app/Providers/Filament/AdminPanelProvider.php` and add the plugin:

```
use LucaPellegrino\DbMyAdmin\DbMyAdminPlugin;

->plugins([
    DbMyAdminPlugin::make(),
])
```

### 4. (Optional) Publish the config

[](#4-optional-publish-the-config)

```
php artisan vendor:publish --tag=dbmyadmin-config
```

This creates `config/dbmyadmin.php` where you can customize the plugin behavior.

---

Configuration
-------------

[](#configuration)

All options live in `config/dbmyadmin.php`:

```
return [
    // Database driver: auto-detected from your DB connection, or set manually
    // Accepted values: 'auto', 'mysql', 'pgsql', 'sqlite'
    'driver' => 'auto',

    // Tables hidden from the table list
    'excluded_tables' => [
        'migrations',
        'dbmyadmin_saved_queries',
        'sessions',
        'cache',
        'jobs',
        'failed_jobs',
        'password_reset_tokens',
        'personal_access_tokens',
    ],

    // SQL Runner settings
    'query_runner' => [
        // SQL statement types blocked in the SQL Runner for safety
        // Add or remove entries to customize which statements are blocked
        'blocked_statements' => [
            'DROP', 'TRUNCATE', 'ALTER', 'CREATE',
            'RENAME', 'GRANT', 'REVOKE', 'LOCK', 'UNLOCK',
        ],

        // Maximum rows returned per query execution
        'max_rows' => 1000,
    ],

    // Name of the table used to store saved queries
    'saved_queries_table' => 'dbmyadmin_saved_queries',

    // Whether to log all operations (CREATE, ALTER, query execution, etc.)
    'logging' => true,
];
```

### Excluding additional tables

[](#excluding-additional-tables)

Add table names to `excluded_tables` to hide them from the interface:

```
'excluded_tables' => [
    'migrations',
    'dbmyadmin_saved_queries',
    'my_sensitive_table',
    'internal_logs',
],
```

### Customizing blocked statements

[](#customizing-blocked-statements)

By default, the SQL Runner blocks dangerous statements. You can customize this list:

```
// Allow TRUNCATE (not recommended in production)
'blocked_statements' => [
    'DROP', 'ALTER', 'CREATE', 'RENAME',
    'GRANT', 'REVOKE', 'LOCK', 'UNLOCK',
],

// Block everything except SELECT
'blocked_statements' => [
    'DROP', 'TRUNCATE', 'ALTER', 'CREATE', 'RENAME',
    'GRANT', 'REVOKE', 'LOCK', 'UNLOCK',
    'INSERT', 'UPDATE', 'DELETE',
],
```

---

Authorization
-------------

[](#authorization)

### Default behavior

[](#default-behavior)

By default, access to DbMyAdmin is controlled by whoever has access to your Filament panel. No extra configuration is needed.

### Filament Shield integration

[](#filament-shield-integration)

DbMyAdmin is fully compatible with [Filament Shield](https://github.com/bezhanSalleh/filament-shield). Once Shield is installed, it automatically generates the following permissions for the plugin:

PermissionControls`view_any_database_table`Access the table list`create_database_table`Create new tables`update_database_table`Alter existing tables`delete_database_table`Truncate / drop tablesAssign these permissions to roles via Shield's interface as you would for any other resource.

### Custom authorization gate

[](#custom-authorization-gate)

You can restrict the entire plugin to specific users via a closure:

```
DbMyAdminPlugin::make()
    ->authorize(fn() => auth()->user()->hasRole('superadmin'))
```

This gate is evaluated before Shield permissions. If it returns `false`, the user cannot access any part of the plugin regardless of their Shield permissions.

### Navigation customization

[](#navigation-customization)

```
DbMyAdminPlugin::make()
    ->navigationGroup('Administration')
    ->navigationIcon('heroicon-o-circle-stack')
```

---

Features
--------

[](#features)

### Table List

[](#table-list)

The main page shows all tables in your database with:

- **Row count** — approximate number of records
- **Data size** — space used by data
- **Index size** — space used by indexes
- **Total size** — combined size
- **Engine** — storage engine (MySQL only)
- **Collation** — character set collation

Available actions per table:

- **Browse** — open the record browser for that table
- **Structure** — view column definitions in a modal
- **Truncate** — delete all records (with confirmation)
- **Truncate (disable FK)** — truncate with foreign key checks disabled

Bulk actions:

- **Truncate selected** — truncate multiple tables at once
- **Truncate selected (disable FK)** — same with FK checks disabled

Header actions:

- **Create Table** — open the table creation wizard
- **SQL Runner** — open the SQL query editor

> Tables listed in `excluded_tables` in the config are not shown.

---

### Browse Table Records

[](#browse-table-records)

Browse, search, create, edit, and delete records in any table.

- Columns are detected automatically from the table structure
- Foreign key columns show a dropdown with values from the related table, auto-detecting a suitable label column
- Supports all common column types: strings, integers, decimals, booleans, dates, datetimes, JSON, text
- Actions per row: **Edit**, **Delete**
- Header action: **Create** new record

> The interface adapts to the actual columns of each table — no configuration required.

---

### SQL Runner

[](#sql-runner)

A full-featured SQL editor with:

**Editor:**

- Syntax-aware text area with autocomplete
- Autocomplete suggests table names, column names, and SQL keywords as you type
- Templates for common queries (SELECT, INSERT, UPDATE, DELETE, etc.)
- Clear button to reset the editor

**Execution:**

- Run button executes the query against your database
- Results displayed in a paginated table with sticky headers
- Shows total rows, execution time, and affected rows
- Blocked statements (configurable) are rejected before execution

**Schema Browser (sidebar):**

- Expandable list of all tables and their columns
- Click a table or column name to insert it into the editor

**Saved Queries:**

- Save any query with a name and optional description
- Search through saved queries
- Load a saved query back into the editor with one click
- Edit the name/description of a saved query
- Delete saved queries

> The SQL Runner only executes queries — it does not modify table structure. Use the Create Table or Alter Table pages for DDL operations.

---

### Create Table

[](#create-table)

A visual wizard for creating new database tables.

**Table options:**

- Table name
- Comment / description
- Storage engine (MySQL)
- Character set and collation (MySQL)

**Columns:**

- Add/remove columns dynamically
- For each column: name, type, length/precision, default value, nullable, unsigned, auto-increment
- Move columns up/down to change order
- Column types available: INT, BIGINT, TINYINT, SMALLINT, MEDIUMINT, FLOAT, DOUBLE, DECIMAL, VARCHAR, CHAR, TEXT, MEDIUMTEXT, LONGTEXT, DATE, DATETIME, TIMESTAMP, TIME, BOOLEAN, JSON, BLOB, ENUM, SET

**Foreign Keys:**

- Add foreign key constraints between tables
- Select the referenced table and column
- Choose ON DELETE and ON UPDATE actions: RESTRICT, CASCADE, SET NULL, NO ACTION

**DDL Preview:**

- Live-generated CREATE TABLE statement
- Inspect the exact SQL before executing

---

### Alter Table

[](#alter-table)

Modify the structure of an existing table.

**Modify existing columns:**

- Change column name, type, length, default, nullable, unsigned
- Mark columns for dropping
- Changes are highlighted visually before applying

**Add new columns:**

- Add one or more new columns
- Specify position (AFTER which existing column)

**DDL Preview:**

- Live-generated ALTER TABLE statement

**Apply:**

- Executes the generated DDL against the database
- Operation is logged

> SQLite has limited ALTER TABLE support. Depending on the SQLite version, some operations (e.g. DROP COLUMN) may be unavailable. Unsupported operations are hidden automatically.

---

Logging
-------

[](#logging)

When `logging` is enabled in config (default: `true`), all operations are written to your Laravel log:

- Table creation
- Table alteration
- Table truncation
- SQL query execution
- Record create/update/delete

Each log entry includes the authenticated user's email and the operation performed.

---

Upgrading
---------

[](#upgrading)

### From Filament 3.3 (app-level code)

[](#from-filament-33-app-level-code)

If you were using an older version of this code directly in your app (before it became a package), follow these steps:

1. Remove the old files from your app:

    - `app/Models/DatabaseTable.php`
    - `app/Models/SavedQuery.php`
    - `app/Filament/Resources/DatabaseTableResource.php`
    - `app/Filament/Resources/DatabaseTableResource/Pages/*`
    - Blade views in `resources/views/filament/pages/`
    - The old migration for `saved_queries`
2. Install the package: `composer require lucapellegrino/dbmyadmin`
3. Publish and run migrations (the table is renamed to `dbmyadmin_saved_queries` — migrate your existing data manually if needed)
4. Register the plugin in your Panel Provider

---

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

[](#troubleshooting)

**The plugin does not appear in the navigation**

- Ensure the plugin is registered in your Panel Provider
- Check that the authenticated user has the `view_any_database_table` Shield permission (if Shield is installed)
- Check that your `->authorize()` closure returns `true` for the current user

**Tables are not showing up**

- Check the `excluded_tables` config — the table may be in the exclusion list
- Ensure the database user has SELECT permissions on `information_schema`

**SQL Runner blocks my query**

- Check `blocked_statements` in config and remove the statement type you need
- Note that DDL operations (CREATE TABLE, ALTER TABLE) have dedicated pages with safer interfaces

**SQLite: Alter Table options are missing**

- SQLite has limited ALTER TABLE support — unsupported operations are hidden automatically
- For complex schema changes on SQLite, consider using Laravel migrations

**Foreign keys not detected in Browse Records**

- Foreign key detection requires the database user to have access to `information_schema.KEY_COLUMN_USAGE`
- On SQLite, foreign key detection uses `PRAGMA foreign_key_list`

---

License
-------

[](#license)

MIT License. See [LICENSE](LICENSE).

###  Health Score

39

—

LowBetter than 84% of packages

Maintenance82

Actively maintained with recent releases

Popularity4

Limited adoption so far

Community6

Small or concentrated contributor base

Maturity55

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 ~0 days

Total

9

Last Release

92d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/be0041ae009dd326d229c028e57b707d3ddd313ac5e541a6a1c25427321e3a7d?d=identicon)[lucapellegrino-70](/maintainers/lucapellegrino-70)

---

Top Contributors

[![B2BSRL](https://avatars.githubusercontent.com/u/162304926?v=4)](https://github.com/B2BSRL "B2BSRL (27 commits)")

---

Tags

laraveldatabasephpmyadminadminfilament

###  Code Quality

TestsPest

### Embed Badge

![Health badge](/badges/lucapellegrino-dbmyadmin/health.svg)

```
[![Health](https://phpackages.com/badges/lucapellegrino-dbmyadmin/health.svg)](https://phpackages.com/packages/lucapellegrino-dbmyadmin)
```

###  Alternatives

[codewithdennis/larament

Larament is a time-saving starter kit to quickly launch Laravel 13.x projects. It includes FilamentPHP 5.x pre-installed and configured, along with additional tools and features to streamline your development workflow.

3991.8k](/packages/codewithdennis-larament)[ercogx/laravel-filament-starter-kit

This is a Filament v5 Starter Kit for Laravel 13, designed to accelerate the development of Filament-powered applications.

461.7k](/packages/ercogx-laravel-filament-starter-kit)[slimani/filament-media-manager

A media manager plugin for Filament.

126.9k](/packages/slimani-filament-media-manager)

PHPackages © 2026

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