Replies: 1 comment 1 reply
-
Here is a simple implementation of how you can currently add a toggle to enable/disable blocks class MyBlock extends PageBlock
{
public static function getBlockSchema(): Block
{
return Block::make('my-block')
->schema([
Toggle::make('enabled')->default(true),
TextInput::make('title'),
]);
}
public static function mutateData(array $data): array
{
return $data;
}
} @props([
'title' => 'foo',
'enabled' => true,
])
@if ($enabled ?? true)
<div class="max-w-7xl mx-auto">
{{ $title }}
</div>
@endif
I'll see if i can work out a easier way to provide, this functionality for all the blocks |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
What do you think about adding a toggle to disable blocks ?
Beta Was this translation helpful? Give feedback.
All reactions