FilamentF
Filament2y ago
12 replies
Jocka

Change a resource attribute/property from an action.

Hey guys, can i somehow change a resource property/attribute from an action like this?

->actions([
                Tables\Actions\ViewAction::make()
                    ->action(function () {
                        $this->contact->read_at = Carbon::now();
                        $this->contact->save();
                    }),
                Tables\Actions\DeleteAction::make(),
            ])

if not, how can i achieve this?
Was this page helpful?