Builder\Block MaxItems show error
Hi Everyone,
I want to limiting the number of times a block but it shows error. I am using the pages. Here is code snippet and error message
Builder::make("content[" . $locale . "]")
->label("Content")
->blockPickerColumns(['sm' => 1, 'md' => 2, 'xl' => 2])
->blockNumbers(false)
->blocks([
Builder\Block::make("location[" . $locale . "]")
->label("Location")
->icon("heroicon-s-map-pin")
->MaxItems(2)
->schema([
...Location::make($locale),
])
]),
Error
array_filter(): Argument #1 ($array) must be of type array, null given
How can i Fix this
10 Replies
does it work if you remove
->MaxItems(2)
?yes @Leandro Ferreira
my Builder\Block want to added by only once not unlimited
I don't think this is the issue
Did you do this?
@Leandro Ferreira I added the above code snippet it working fine. But this code snippet cannot find under form builder? Why?
what does it mean?
I cannot find this code snippet under the Form Builder documentation. Why?
while adding maxItems
I got it, Thanks @Leandro Ferreira