Skip to content

Commit d352d0b

Browse files
authored
Merge pull request #2 from tomatophp/develop
add type register facade
2 parents d7b6892 + 2e01841 commit d352d0b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Resources/TypeResource.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ public static function table(Table $table): Table
164164
->form([
165165
Forms\Components\Select::make('for')
166166
->label(trans('filament-types::messages.form.for'))
167-
->options(config('filament-types.for'))
167+
->options(static::getTypes())
168168
->searchable()
169169
->afterStateUpdated(function (Forms\Set $set){
170170
$set('type', null);
@@ -173,7 +173,7 @@ public static function table(Table $table): Table
173173
->live(),
174174
Forms\Components\Select::make('type')
175175
->label(trans('filament-types::messages.form.type'))
176-
->options(fn(Forms\Get $get) => collect(config('filament-types.types'))->filter(fn($type, $key) => $key === $get('for'))->toArray())
176+
->options(fn(Forms\Get $get) => $get('for') ? static::getTypes($get('for')) : [])
177177
->searchable(),
178178
Forms\Components\Select::make('parent_id')
179179
->label(trans('filament-types::messages.form.parent_id'))

0 commit comments

Comments
 (0)