mrpowerup/filament-sql-field
Composer 安装命令:
composer require mrpowerup/filament-sql-field
包简介
And a field to write SQL sentences using codemirror 5.
README 文档
README
Installation Filament v5.x
You can install the package via composer:
composer require mrpowerup/filament-sql-field
Installation Filament v4.x
You can install the package via composer:
composer require mrpowerup/filament-sql-field "dev-filament-v4"
Installation Filament v3.x
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
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
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
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
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
- 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:
$this->dispatch('updatePlugin', $record->sql);
@script
<script>
$wire.on('updatePlugin', (event) => {
window.editor.setValue(event[0]);
});
</script>
@endscript
Links
License
The MIT License (MIT). Please see License File for more information.
mrpowerup/filament-sql-field 适用场景与选型建议
mrpowerup/filament-sql-field 是一款 基于 JavaScript 开发的 Composer 扩展包,目前已累计 1.22k 次下载、GitHub Stars 达 13, 最近一次更新时间为 2024 年 07 月 20 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「laravel」 「filament」 「MrPowerUp」 「filament-sql-field」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 mrpowerup/filament-sql-field 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 mrpowerup/filament-sql-field 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 mrpowerup/filament-sql-field 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Alfabank REST API integration
Database-driven onboarding for Filament: progress checklists and guided spotlight tours, translatable to any locale.
Laravel package for Accurate Online API integration.
Create-project starter for a Laravel application with the public Capell CMS foundation.
Shared RCX Laravel DataTables UI and configuration helpers.
Boot a Laravel project on any machine with one command: app:serve installs missing tools (PHP, Node, Composer, Herd, Docker), creates .env, sets up the database, runs migrations, builds assets, starts a queue worker and serves via Herd, Sail or artisan serve; app:down cleanly stops everything it sta
统计信息
- 总下载量: 1.22k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 13
- 点击次数: 28
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2024-07-20


