You can install the package via composer:
composer require mrpowerup/filament-sql-field "dev-filament-v4"
You can install the package via composer:
composer require mrpowerup/filament-sql-field
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"
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(), ]) ]); }
$this->dispatch('updatePlugin', $record->sql);
@script <script> $wire.on('updatePlugin', (event) => { window.editor.setValue(event[0]); }); </script>@endscript
The MIT License (MIT). Please see License File for more information.