getting form data from filament Repeater
Hi everyone, I am using filament repeater and everything is fine when using ->relationship(). The data is updated on edit correctly. But I want to access the information inside repeater forms before saving changes in edit action, and $data shows empty array while I have some data in my repeater. Here's code in edit:
Removing ->relationship() in my resource makes this data accessible through $data when creating new records. But removing ->relationship() causes empty repeater when editing. Any idea of how I can access and modify repeater data inside edit action?
namespace App\Filament\Resources\OrderResource\Pages;
use App\Filament\Resources\OrderResource;
use Filament\Actions;
use Filament\Resources\Pages\EditRecord;
use App\Models\Order;
use Illuminate\Database\Eloquent\Model;
class EditOrder extends EditRecord
{
protected static string $resource = OrderResource::class;
protected function getHeaderActions(): array
{
return [
// Actions\DeleteAction::make(),
];
}
protected function handleRecordUpdate(Model $record, array $data): Model
{
dd($data);
$record->update($data);
return $record;
}
}Removing ->relationship() in my resource makes this data accessible through $data when creating new records. But removing ->relationship() causes empty repeater when editing. Any idea of how I can access and modify repeater data inside edit action?