Candace
0
Q:

adding soft delete in pivot table

public function groups() {
    return $this->belongsToMany(Group::class)
    ->wherePivot('deleted_at', null)
    ->withTimestamps();
}

$user->groups
	->updateExistingPivot($groupId, ['deleted_at' => Carbon\Carbon::now()]);
0

New to Communities?

Join the community