mikebronner / laravel-model-caching

Eloquent model-caching made easy.
MIT License
2.24k stars 213 forks source link

Trait method 'newBelongsToMany' will not be applied, because it collides with 'ExtendRelationsTrait' #354

Closed smartssa closed 4 years ago

smartssa commented 4 years ago

Describe the bug It's a strange phpStorm code linter warning that makes me think something with relations may not work as expected.

When implementing a use Cachable in my model: "Trait method 'newBelongsToMany' will not be applied, because it collides with 'ExtendRelationsTrait'"

Environment

Additional context Could be a non-issue.

mikebronner commented 4 years ago

Hi @smartssa This is probably an indicator that you have a conflicting plugin that employs ExtendRelataionsTrait. Is that accurate?

smartssa commented 4 years ago

Not that I am aware of, I will investigate.

smartssa commented 4 years ago

I don't have any other items that use ExtendRelataionsTrait, but I've discovered that phpStorm 2020.1.1 isn't giving this error. I'll go complain to them. Thanks!

mikebronner commented 4 years ago

Would you mind doing a global search for ExtendRelataionsTrait in your code and vendor files to see where this exists?

smartssa commented 4 years ago

Only mentions are: /laravel-pivot-events/src/Traits/ExtendRelationsTrait.php /laravel-pivot-events/src/Traits/PivotEventTrait.php

Found a few issues on JetBrains: https://youtrack.jetbrains.com/issue/WI-53153 https://youtrack.jetbrains.com/issue/WI-53171

mikebronner commented 4 years ago

Ah! Perfect :) whew