php - SoftDelete records in Pivot table Laravel -
i have issue soft deleting of records in pivot table in laravel 5.4 application. in records.php have association teams like:
public function teams() { return $this->belongstomany(team::class) ->withtimestamps(); }
when update record, use sync method add/remove teams. teams selected in multiple select form field , updated like:
$record->teams()->sync($request->get('teams'));
when adding new teams, pivot table update created_at , updated_at. when removing pivot table record, whole row deleted , deleted_at not set? how can soft deleting work in pivot table.
Comments
Post a Comment