fairygamer
fairygamer
FFilament
Created by fairygamer on 8/27/2023 in #❓┊help
How to load the json column data as a checkboxList
I have a json column named cpts and it has following json values
[
{ "code": "99223", "description": "INITIAL HOSPITAL CARE" },
{ "code": "99222", "description": "HOSPITAL ADMIT DIRECT" }
]
[
{ "code": "99223", "description": "INITIAL HOSPITAL CARE" },
{ "code": "99222", "description": "HOSPITAL ADMIT DIRECT" }
]
I want to populate the checkboxlist and the checkbox has to be checked and while saving, it has to save in above format itself. So far my code as below
\Filament\Forms\Components\CheckboxList::make('cpts')
->options(function (callable $get) {
$cpt_options = [];
foreach($get('cpts') as $cpt) {
$cpt_options[] = $cpt['code'] . ' - ' . $cpt['description'];
}
return $cpt_options;
})
\Filament\Forms\Components\CheckboxList::make('cpts')
->options(function (callable $get) {
$cpt_options = [];
foreach($get('cpts') as $cpt) {
$cpt_options[] = $cpt['code'] . ' - ' . $cpt['description'];
}
return $cpt_options;
})
Can someone help on this ?
2 replies
FFilament
Created by fairygamer on 3/23/2023 in #❓┊help
How to pass relationship value to the TextInput
I have a relationship field where I want to display the value in the form. Eg: Mail Assigned Table and the Mails Table. Im listing the records from the Assigned table when I click edit, I want to display the email content from the Mail table. How to achieve this?
37 replies