laravel-pivot-softdeletes icon indicating copy to clipboard operation
laravel-pivot-softdeletes copied to clipboard

Not compatible with Nova

Open jmverges opened this issue 1 year ago • 1 comments

👋 Hello,

I'm using this package and it works great with my own controller and so but I just found when detaching from Nova the softdeletes are not used at all. Anyone experienced the same?

Many thanks.

jmverges avatar Apr 04 '23 19:04 jmverges

For future me:

this is solved it.

return $this->belongsToMany(\App\Models\YourModel::class, 'models_models')->using(\DDZobov\PivotSoftDeletes\Relations\Pivot:class)->withSoftDeletes();

Maybe readme could mention Nova will need explicit pivot class assigned, even if it is the default one provided by this package.

jmverges avatar Apr 05 '23 06:04 jmverges