As far as I can tell, there is no way to have a longer description for each checkbox list item. Like a ->helperText() per option. I know you can use getOptionLabelFromRecordUsing(), but that doesnt allow HtmlString() as a return option, so can format the description at all. They are going to be 1-3 sentences, so not short. Trying out something like
public function programCheckboxes(): array { return Program::all()->map(function ($program) { return Checkbox::make('programs[' . $program->id . ']') ->label($program->full_name) ->helperText(function () use ($program) { if ($program->description) { return new HtmlString('<div class="ml-7">' . $program->description . '</div>'); } return null; }); })->toArray(); }
public function programCheckboxes(): array { return Program::all()->map(function ($program) { return Checkbox::make('programs[' . $program->id . ']') ->label($program->full_name) ->helperText(function () use ($program) { if ($program->description) { return new HtmlString('<div class="ml-7">' . $program->description . '</div>'); } return null; }); })->toArray(); }
, but i need to figure out the proper way to associate that, havent figured out the proper make() for that yet. Also means I have to recreate the ->bulkToggleable() functionality as well. Maybe i just need to extend the CheckboxList component? Sorry, thinking out loud here. lol.