Cannot instantiate trait Chelout\RelationshipEvents\Concerns\HasBelongsToManyEvents
Closed this issue · 3 comments
LeeGarden commented
I using this code
protected $dispatchesEvents = [ 'belongsToManyAttached' => HasBelongsToManyEvents::class, ];
And it show exception.
Cannot instantiate trait Chelout\RelationshipEvents\Concerns\HasBelongsToManyEvents
Please help me solve it.
chelout commented
You've got an error in your code. You should assign your own event class like this:
protected $dispatchesEvents = [
'belongsToManyAttached' => YourOwnEvent::class,
];
And one more thing, there is a bug with dispatchable events for now. I'll fix it as soon as i find proper way to do it, hope to manage it today.
chelout commented
In order to fix the issue update to the latest release