You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm using the QueriesFlaggedEnums trait in the Badge model. I've defined a local scope which use the hasAnyFlags(). PHPstan raises an error like:
------ ----------------------------------------------------------------------------------
Line app/Models/Badge.php
------ ----------------------------------------------------------------------------------
109 Call to an undefined method Illuminate\Database\Eloquent\Builder::hasAnyFlags().
------ ----------------------------------------------------------------------------------
Have you tried adding generics to your own code? I think we should try and add them to this library too, but without having them in your code there is nothing to work with. This library cannot magically conjure up a connection from any Builder object to one where the generic TModel is provided.
I'm using the
QueriesFlaggedEnums
trait in theBadge
model. I've defined a local scope which use thehasAnyFlags()
. PHPstan raises an error like:This is the Laravel code:
Someone was suggesting the use of PHP generics in order to avoid the problem. I've tried this approach using an stub file but nothing has changed.
The code could be find here: https://github.com/pacoorozco/gamify-laravel
Related to: larastan/larastan#1307
The text was updated successfully, but these errors were encountered: