Skip to content

Commit

Permalink
added collapsible to sections
Browse files Browse the repository at this point in the history
  • Loading branch information
bezhanSalleh committed Sep 16, 2023
1 parent 36bfd6a commit d192852
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions src/Resources/RoleResource.php
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ public static function form(Form $form): Form
Forms\Components\Grid::make()
->schema(static::getResourceEntitiesSchema())
->columns([
'sm' => 2,
'lg' => 3,
'sm' => 1,
'lg' => 1,
]),
]),
Forms\Components\Tabs\Tab::make(__('filament-shield::filament-shield.pages'))
Expand Down Expand Up @@ -331,9 +331,8 @@ public static function getResourceEntitiesSchema(): ?array
return collect(FilamentShield::getResources())->sortKeys()->reduce(function ($entities, $entity) {

$entities[] = Forms\Components\Section::make(FilamentShield::getLocalizedResourceLabel($entity['fqcn']))
->description(Utils::showModelPath($entity['fqcn']))
->description(fn () => new HtmlString('<span style="word-break: break-word;">'.Utils::showModelPath($entity['fqcn']).'</span>'))
->compact()
->extraAttributes(['class' => 'border-0 shadow-lg'])
->schema([
Forms\Components\CheckboxList::make($entity['resource'])
->label('')
Expand Down Expand Up @@ -367,11 +366,13 @@ public static function getResourceEntitiesSchema(): ?array
->bulkToggleable()
->gridDirection('row')
->columns([
'default' => 1,
'sm' => 2,
'default' => 2,
'sm' => 3,
'lg' => 4
]),
])
->columnSpan(1);
->columnSpanFull()
->collapsible();

return $entities;
}, collect())
Expand Down

0 comments on commit d192852

Please sign in to comment.