Skip to content

Commit

Permalink
support blocks with no fields
Browse files Browse the repository at this point in the history
  • Loading branch information
michael-sevendays-be committed Nov 13, 2023
1 parent f0f3b67 commit 300b4f5
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/FilamentPageBuilderServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Filament\Support\Facades\FilamentAsset;
use Illuminate\Filesystem\Filesystem;
use Sevendays\FilamentPageBuilder\Commands\MakePageBuilderBlock;
use Sevendays\FilamentPageBuilder\Models\Block;
use Spatie\LaravelPackageTools\Package;
use Spatie\LaravelPackageTools\PackageServiceProvider;

Expand All @@ -28,6 +29,15 @@ public function packageBooted(): void
FilamentAsset::register([
Css::make('plugin-filament-page-builder', __DIR__.'/../resources/dist/filament-page-builder.css'),
], 'sevendays/filament-page-builder');

// support 'empty' form blocks
Block::creating(function (Block $model) {
if ($model->content == null) {
$model->content = [];
}

return $model;
});
}

public function register(): void
Expand Down

0 comments on commit 300b4f5

Please sign in to comment.