Skip to content

Commit

Permalink
support blocks with no fields -> more robust
Browse files Browse the repository at this point in the history
  • Loading branch information
Michael Metdepenningen committed Nov 13, 2023
1 parent 3ae0648 commit 20cc13b
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/FilamentPageBuilderServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,9 @@ public function packageBooted(): void

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

return $model;
});
}
Expand Down

0 comments on commit 20cc13b

Please sign in to comment.