PHPackages                             mrpowerup/filament-sql-field - 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. [Utility &amp; Helpers](/categories/utility)
4. /
5. mrpowerup/filament-sql-field

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mrpowerup/filament-sql-field
============================

And a field to write SQL sentences using codemirror 5.

2.0.2(4mo ago)181.3k↓82.1%1MITJavaScriptPHP ^8.2

Since Jul 21Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/MrPowerUp82/filament-sql-field)[ Packagist](https://packagist.org/packages/mrpowerup/filament-sql-field)[ RSS](/packages/mrpowerup-filament-sql-field/feed)WikiDiscussions main Synced yesterday

READMEChangelog (8)Dependencies (13)Versions (14)Used By (0)

filament-sql-field
==================

[](#filament-sql-field)

[![image](example_1.png)](example_1.png)[![image](example_2.png)](example_2.png)[![image](example_3.gif)](example_3.gif)

Installation Filament v5.x
--------------------------

[](#installation-filament-v5x)

You can install the package via composer:

```
composer require mrpowerup/filament-sql-field
```

Installation Filament v4.x
--------------------------

[](#installation-filament-v4x)

You can install the package via composer:

```
composer require mrpowerup/filament-sql-field "dev-filament-v4"
```

Installation Filament v3.x
--------------------------

[](#installation-filament-v3x)

You can install the package via composer:

```
composer require mrpowerup/filament-sql-field "dev-filament-v3"
```

Or if you want to use 1.x version of the package you can use:

```
composer require mrpowerup/filament-sql-field "^1.0"
```

Or if you want to use 2.x version of the package you can use:

```
composer require mrpowerup/filament-sql-field "^2.0"
```

Usage
-----

[](#usage)

```
use MrPowerUp\FilamentSqlField\FilamentSqlSection;
use MrPowerUp\FilamentSqlField\FilamentSqlField;
```

```
public static function form(Form $form): Form
    {
        return $form
            ->schema([
                   FilamentSqlSection::make()
                    ->schema([
                        FilamentSqlField::make('sql')
                            ->fullscreen() // Allow Fullscreen mode
                            ->editorHeight(300) // Set height of editor
                            ->autoGetTables() // Automatically get tables from database
                            ->default("SELECT * FROM users WHERE 1;")
                            ->columnSpanFull(),
                    ])
            ]);
    }
```

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

[](#configuration)

You can publish the configuration file using:

```
php artisan vendor:publish --tag="filament-sql-field-config"
```

This will create a `config/filament-sql-field.php` file where you can customize the available SQL dialects and add predefined templates.

### Dialects

[](#dialects)

You can define which SQL dialects are available in the editor's "Change Meme" dropdown:

```
'dialects' => [
    'text/x-sql' => 'SQL',
    'text/x-mysql' => 'MySQL',
    // ...
],
```

### Templates

[](#templates)

You can add predefined SQL templates that users can insert via the "Templates" dropdown:

```
'templates' => [
    'User Select' => 'SELECT * FROM users;',
    'Active Orders' => 'SELECT * FROM orders WHERE status = \'active\';',
],
```

MIME types defined
------------------

[](#mime-types-defined)

- text/x-sql
- text/x-mysql
- text/x-mariadb
- text/x-cassandra
- text/x-plsql
- text/x-mssql
- text/x-hive
- text/x-pgsql
- text/x-gql
- text/x-gpsql
- text/x-esper
- text/x-sqlite
- text/x-sparksql
- text/x-trino

### If you need to update the editor value with dispatch here is an example:

[](#if-you-need-to-update-the-editor-value-with-dispatch-here-is-an-example)

```
$this->dispatch('updatePlugin', $record->sql);
```

```
@script

        $wire.on('updatePlugin', (event) => {
            window.editor.setValue(event[0]);
        });

@endscript
```

Links
-----

[](#links)

- [Source Code](https://github.com/MrPowerUp82/filament-sql-field)
- [Packagist](https://packagist.org/packages/mrpowerup/filament-sql-field)

License
-------

[](#license)

The MIT License (MIT). Please see [License File](https://raw.githubusercontent.com/MrPowerUp82/filament-sql-field/main/LICENSE.md) for more information.

###  Health Score

46

—

FairBetter than 92% of packages

Maintenance75

Regular maintenance activity

Popularity28

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity60

Established project with proven stability

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

Recently: every ~123 days

Total

10

Last Release

133d ago

Major Versions

1.1.3 → 2.x-dev2025-08-19

PHP version history (2 changes)1.0.9PHP ^8.1

2.0.1PHP ^8.2

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/24375099?v=4)[MrPowerUp](/maintainers/MrPowerUp)[@MrPowerup](https://github.com/MrPowerup)

---

Top Contributors

[![MrPowerUp82](https://avatars.githubusercontent.com/u/70461958?v=4)](https://github.com/MrPowerUp82 "MrPowerUp82 (45 commits)")

---

Tags

filamentfilament-pluginfilamentphplaravelphplaravelfilamentMrPowerUpfilament-sql-field

###  Code Quality

TestsPest

Code StyleLaravel Pint

### Embed Badge

![Health badge](/badges/mrpowerup-filament-sql-field/health.svg)

```
[![Health](https://phpackages.com/badges/mrpowerup-filament-sql-field/health.svg)](https://phpackages.com/packages/mrpowerup-filament-sql-field)
```

###  Alternatives

[codewithdennis/filament-select-tree

The multi-level select field enables you to make single selections from a predefined list of options that are organized into multiple levels or depths.

329530.5k29](/packages/codewithdennis-filament-select-tree)[ysfkaya/filament-phone-input

A phone input component for Laravel Filament

3161.3M25](/packages/ysfkaya-filament-phone-input)[awcodes/richer-editor

A collection of extensions and tools to enhance the Filament Rich Editor field.

3912.9k9](/packages/awcodes-richer-editor)[rawilk/filament-password-input

Enhanced password input component for filament.

52263.4k14](/packages/rawilk-filament-password-input)[schmeits/filament-character-counter

This is a Filament character counter TextField and Textarea form field for Filament v4 and v5

34226.4k13](/packages/schmeits-filament-character-counter)[tonegabes/filament-better-options

Filament form components for better radio and checkbox options.

1610.3k](/packages/tonegabes-filament-better-options)

PHPackages © 2026

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