ImShehryar
InfoList Tabs Query
For example Meetings hasMany resolutions and resolutions table consists of a boolean column 'resolution_passed' as true or false:
How to filter as 'Passed' and 'Rejected' and show in separate tabs in infoList tabs:
Section::make('Resolutions details')
->schema([
Tabs::make('Resolutions')
->tabs([
Tabs\Tab::make('Passed')
->schema([
// query resolutions where 'resultion_passed' = true
]),
Tabs\Tab::make('Rejected')
->schema([
// query resolutions where 'resultion_passed' = false
]),
])
])
->compact()
->collapsible()
11 replies
CheckboxList Relationship Options Descriptions
How to get relationship options descriptions ? and the description should be some other column like e.g. designation:
Like this:
John Doe
Programmer
Forms\Components\CheckboxList::make('officials')
->label(false)
->relationship('officials', 'first_name', function (Builder $query, Get $get) {
return $query
->orderBy('first_name')
->orderBy('last_name')
->where('board_id', $get('board_id'))
->where('member_of_board', true);
})
->getOptionLabelFromRecordUsing(fn (Model $record) => "{$record->first_name} {$record->last_name}")
->hidden(function (Get $get) {
return $get('board_id') == false;
})
->columns(['sm' => 2, 'md' => 3, 'lg' => 4])
->bulkToggleable()
->required()
->gridDirection('row')
7 replies
Show an alert above the table conditionally
How to show an alert or a message above the table if a table column data contains a null value for example...and this message or alert toggles conditionally based on a filter..
Showing a widget above the table does the trick.. but i dont want to run the query in the widget again...
Is it possible...
6 replies