F
Filament17mo ago
tesse05

Repeater with hasMany relationship

I have this repeater field which is populated from a has many relationship. When adding some values, it saves correctly but delete the existent ones. It also doesn't show the current records. Any ideas?
5 Replies
toeknee
toeknee17mo ago
Are you pre-loading the existing values with mount?
tesse05
tesse0517mo ago
how to do this
toeknee
toeknee17mo ago
$this->form->fill([]);
toeknee
toeknee17mo ago
It depends on your whole code basis, but you might want mount using too https://filamentphp.com/docs/2.x/admin/pages/actions#filling-default-data
Filament
Actions - Pages - Admin Panel - Filament
The elegant TALL stack admin panel for Laravel artisans.
tesse05
tesse0517mo ago
oh thats perfect. thx!