Askedio / laravel-soft-cascade

Cascade Delete & Restore when using Laravel SoftDeletes
https://medium.com/asked-io/cascading-softdeletes-with-laravel-5-a1a9335a5b4d
MIT License
705 stars 63 forks source link

Bad pivot key name used on BelongsToMany relation #61

Closed squiaios closed 6 years ago

squiaios commented 6 years ago

On belongs to many relation, a bad pivot key name is used to find the good relation

https://github.com/Askedio/laravel5-soft-cascade/blob/d0424664f3f1e0b9a0c823cf1d2cf6bd00884e6d/src/SoftCascade.php#L146

Changing getQualifiedForeignPivotKeyName with getRelatedPivotKeyName works for me :)

maguilar92 commented 6 years ago

Hello @squiaios Can you post the error and the related models to check your error?

Thank you

squiaios commented 6 years ago

I have no PHP / eloquent error

Class Foo Foo.txt

Class Bar Bar.txt

Migrations 2018_04_15_000000_create_foos_table.txt 2018_04_16_000000_create_bars_table.txt 2018_04_17_160000_create_bar_foo_table.txt

Seeder FooBarSeeder.txt

Tinker App\Models\Foo::find(16)->delete();

squiaios commented 6 years ago

Is it possible to make this fix available on laravel 5.5 please :)

maguilar92 commented 6 years ago

@squiaios Yes, I will do it. I will check package maintenance to follow laravel version standards.

maguilar92 commented 6 years ago

@gcphost Can you create or add me roles for create: 5.5 branch with 5.5.13 version code 5.6 branch with master branch code

With this branches I will make package maintenance to follow laravel versions lifecycle.

gcphost commented 6 years ago

Permissions updated @maguilar92 , you should be able to do this now.

maguilar92 commented 6 years ago

@gcphost I can't still create branches.

captura de pantalla 2018-04-21 a las 18 59 32
gcphost commented 6 years ago

Weird, I thought as an admin you'd get to do that.

I've created both branches. Let me know if I've done something wrong.

maguilar92 commented 6 years ago

@squiaios Available now at version 5.5.14. You must change dependency name in composer.json from askedio/laravel5-soft-cascade to askedio/laravel-soft-cascade

squiaios commented 6 years ago

perfect, thank you :)