chelout/laravel-relationship-events

Telescope compatible

reefki opened this issue · 4 comments

I just recently installed Telescope and got an error when inserting belongsToMany relation.

get_class() expects parameter 1 to be object, string given

Stacktrace:

../vendor/laravel/telescope/src/Watchers/ModelWatcher.php:35
--
../vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:357
../vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:209
../vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php:169
../vendor/chelout/laravel-relationship-events/src/Concerns/HasBelongsToManyEvents.php:187
../vendor/chelout/laravel-relationship-events/src/BelongsToMany.php:47

Is there any chance to get this package compatible with telescope?

Need time to work it out.

I think it's because of the first parameter on HasBelongsToManyEvents events is the relation name. Not sure but it looks like this order should work: ($parent, $relation, $ids, $attributes)

Yes, that looks correct, but i have to investigate a little further.

Ok, this bug was fixed in laravel/telescope#284
Maybe we still need to change order of params.