Skip to content

Instantly share code, notes, and snippets.

@awcodes
Created November 13, 2022 14:52
Show Gist options
  • Save awcodes/bc8c47da29637efdd42bf37efc923040 to your computer and use it in GitHub Desktop.
Save awcodes/bc8c47da29637efdd42bf37efc923040 to your computer and use it in GitHub Desktop.
Filament Block Settings
<div
{{ $attributes->merge($getExtraAttributes()) }}
>
<details
class="open:bg-white dark:open:bg-slate-900/50 open:border-b open:border-gray-300 open:dark:border-gray-700 p-4 -mx-4 -mt-4 -mb-4 open:mb-0"
wire:ignore.self
wire:key="{{ $this->id }}.{{ $getStatePath() }}.block-settings"
>
<summary class="filament-link cursor-pointer text-sm">Block Settings</summary>
<div class="pt-6">
{{ $getChildComponentContainer() }}
</div>
</details>
</div>
<?php
namespace App\Forms\Components;
use Filament\Forms\Components\Group;
class BlockSettings extends Group
{
protected string $view = 'filament.forms.components.block-settings';
protected function setUp(): void
{
$this->statePath('settings');
$this->columnSpan('full');
$this->columns(['md' => 12, 'lg' => null]);
}
}
Block::make('rich-text')
->label('Rich Text')
->schema([
BlockSettings::make([
...fields
]),
...
]),
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment