© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
FilamentF
Filament•3y ago•
22 replies
ingmontoya

handleRecordUpdate

Hi, I'm trying to get the relation data within the handleRecordUpdate
   protected function handleRecordUpdate(Model $record, array $data): Model
    {
        dd($record->toArray(), $data);
        $record->editOrder($data);
        $this->updateProductQty($record);
        return $record;
    }
   protected function handleRecordUpdate(Model $record, array $data): Model
    {
        dd($record->toArray(), $data);
        $record->editOrder($data);
        $this->updateProductQty($record);
        return $record;
    }

It's a resource page, not a modal... but I don't know how do I get the relationship data:
return Repeater::make('items')
            ->relationship()
            ->schema([
                Forms\Components\Select::make('shop_product_id')
                    ->label('Product')
                    ->translateLabel()
                    ->options(Product::query()->pluck('name', 'id'))
                    ->required()
                    ->reactive()
                    ->afterStateUpdated(fn ($state, Forms\Set $set) => $set('unit_price', Product::find($state)?->price ?? 0))
                    ->distinct()
                    ->disableOptionsWhenSelectedInSiblingRepeaterItems()
                    ->columnSpan([
                        'md' => 5,
                    ])
                    ->searchable(),
return Repeater::make('items')
            ->relationship()
            ->schema([
                Forms\Components\Select::make('shop_product_id')
                    ->label('Product')
                    ->translateLabel()
                    ->options(Product::query()->pluck('name', 'id'))
                    ->required()
                    ->reactive()
                    ->afterStateUpdated(fn ($state, Forms\Set $set) => $set('unit_price', Product::find($state)?->price ?? 0))
                    ->distinct()
                    ->disableOptionsWhenSelectedInSiblingRepeaterItems()
                    ->columnSpan([
                        'md' => 5,
                    ])
                    ->searchable(),

Can anyone help ? thanks!
Filament banner
FilamentJoin
A powerful open source UI framework for Laravel • Build and ship admin panels & apps fast with Livewire
20,307Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Delete equivalent of handleRecordUpdate or handleRecordCreation
FilamentFFilament / ❓┊help
12mo ago
handleRecordUpdate doesn't work in ManageRecords
FilamentFFilament / ❓┊help
3y ago
Why Error inject param Action Class in `handleRecordUpdate()`
FilamentFFilament / ❓┊help
9mo ago