Advanced toggle column to a table

ToggleColumn::make('collected')

My database table doesn't have an is_collected column. Instead, I have a collected_by column (foreign key to a collectors table) and a collected_at timestamp. How can I customize the ToggleColumn to update the collected_by and collected_at columns when toggled on, ideally setting collected_by to auth()->user()->collector_id? By default the toggle sets is_collected to 1 but that column does not exist.
Was this page helpful?