Thigah Alattass
Thigah Alattass
FFilament
Created by Thigah Alattass on 9/10/2023 in #❓┊help
Select [all options] of dropdown inside repeater
I have (not multiple) select inside a repeater i use the repeater when i want to select more than one option i need to be able to select all options either by add a new option to dropdown or any other way such as radio
Forms\Components\Repeater::make('featuresTest')
->itemLabel(fn (array $state): ?string => Feature::query()->where('id',$state['feature_id'])->first()['name']?? null)
->relationship()
->schema([
Forms\Components\Select::make('feature_id')
->label('Feature')

->options(function(callable $get){
$test_type = $get('../../type');
if(!$test_type){
return ['Please, Enter the type first'];
}
return Feature::where('type',$test_type)->pluck('name','id');
})
->required()
->reactive()

->columnSpan([
'md' => 7,
])
Forms\Components\Repeater::make('featuresTest')
->itemLabel(fn (array $state): ?string => Feature::query()->where('id',$state['feature_id'])->first()['name']?? null)
->relationship()
->schema([
Forms\Components\Select::make('feature_id')
->label('Feature')

->options(function(callable $get){
$test_type = $get('../../type');
if(!$test_type){
return ['Please, Enter the type first'];
}
return Feature::where('type',$test_type)->pluck('name','id');
})
->required()
->reactive()

->columnSpan([
'md' => 7,
])
13 replies
FFilament
Created by Thigah Alattass on 9/6/2023 in #❓┊help
In index/list page, the table by default list all items. How can i specify the items to be viewed
Example: in Users Resource table, all users are listed when i need to list only active users (where is_active = true)
3 replies
FFilament
Created by Thigah Alattass on 7/19/2023 in #❓┊help
Dependent select input
I need feature_id dropdown to be populated depending on test_type value but $get('test_type') is giving me null ->schema([ Forms\Components\Group::make() ->schema([ Forms\Components\Card::make() ->schema([ Card::make()->schema([ TextInput::make('name')->required(), ]), Select::make('test_type') ->required() ->options([ 'auto-test' => 'Auto Test', 'stress-test' => 'Stress Test', ]) ->reactive(), //->afterStateUpdated(function(callable $set){$set('feature_id',null);
// }), Forms\Components\MarkdownEditor::make('notes') ->columnSpan('full'), Forms\Components\Select::make('status') ->default('pending') ->options([ 'pending' => 'Pending', 'processing' => 'Processing', 'completed' => 'Completed', 'failed' => 'Failed', 'has error' => 'Has Error', ]) ->hiddenOn('create'),]) ->columns(2),
8 replies