From d6591741391ca85251908db78c8918065d5459c6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Azad=20Furkan=20=C5=9EAKAR?= Date: Fri, 9 Aug 2024 13:59:09 +0300 Subject: [PATCH] wip --- .phpunit.cache/test-results | 2 +- src/Filament/Resources/FormBuilderCollectionResource.php | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results index e17161a..d67d147 100644 --- a/.phpunit.cache/test-results +++ b/.phpunit.cache/test-results @@ -1 +1 @@ -{"version":"pest_2.35.0","defects":[],"times":{"P\\Tests\\ExampleTest::__pest_evaluable_it_can_test":0.001,"P\\Tests\\ArchTest::__pest_evaluable_it_will_not_use_debugging_functions":0.143}} \ No newline at end of file +{"version":"pest_2.35.0","defects":[],"times":{"P\\Tests\\ExampleTest::__pest_evaluable_it_can_test":0.001,"P\\Tests\\ArchTest::__pest_evaluable_it_will_not_use_debugging_functions":0.152}} \ No newline at end of file diff --git a/src/Filament/Resources/FormBuilderCollectionResource.php b/src/Filament/Resources/FormBuilderCollectionResource.php index ef2c826..05f8673 100644 --- a/src/Filament/Resources/FormBuilderCollectionResource.php +++ b/src/Filament/Resources/FormBuilderCollectionResource.php @@ -36,23 +36,27 @@ public static function form(Form $form): Form Forms\Components\TextInput::make('name') ->label('Adı') ->required(), - Forms\Components\Select::make('type') + Forms\Components\ToggleButtons::make('type') ->label('Tipi') ->live() + ->inline() ->options([ 'list' => 'Liste', 'model' => 'Model', ]) + ->default('list') ->required(), Forms\Components\Select::make('model') ->label('Model') ->visible(fn ($get) => $get('type') === 'model') ->live() + ->native(false) + ->preload() ->options(function () { $collections = FormBuilderHelper::getAllResources(); return [ - config('filament-form-maker.extra_collections'), + ...(array) config('filament-form-maker.extra_collections'), ...$collections, ]; })