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

Popular posts from this blog

ubuntu - PHP script to find files of certain extensions in a directory, returns populated array when run in browser, but empty array when run from terminal -

php - How can i create a user dashboard -

javascript - How to detect toggling of the fullscreen-toolbar in jQuery Mobile? -