Save multiple days in table

Hello guys, I have this entry and I need to save different days in it, but writing them does not seem like the best option, I was thinking of using select or checkbox, but I don't know what they recommend, I think there is a way to enter several days using select Right, for example I need to enter days like: Monday, Wednesday and Friday, in other cases different days, what do you suggest or rather how do I do this? What filament component would be correct to work with?
No description
1 Reply
TranceCode
TranceCodeOP13mo ago
Well i fix this using checbbox List https://filamentphp.com/docs/3.x/forms/fields/checkbox-list like this example:
use Filament\Forms\Components\CheckboxList;

CheckboxList::make('technologies')
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
])
use Filament\Forms\Components\CheckboxList;

CheckboxList::make('technologies')
->options([
'tailwind' => 'Tailwind CSS',
'alpine' => 'Alpine.js',
'laravel' => 'Laravel',
'livewire' => 'Laravel Livewire',
])
and using cast in my Model for returned in JSON Format when edit a register
use Illuminate\Database\Eloquent\Model;

class App extends Model
{
protected $casts = [
'technologies' => 'array',
];

// ...
}
use Illuminate\Database\Eloquent\Model;

class App extends Model
{
protected $casts = [
'technologies' => 'array',
];

// ...
}
Want results from more Discord servers?
Add your server