Replies: 1 comment
-
Another challenge I have is with the models themselves. Let's say I have a method and want to accept only models that implement |
Beta Was this translation helpful? Give feedback.
-
Another challenge I have is with the models themselves. Let's say I have a method and want to accept only models that implement |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Let's say I have an interface for models called
Translatable
, and part of this interface are also scopes for filtering and sorting. In another place, I have a method that accepts anEloquent\Builder
instance to perform some querying. This method should only accept instances for models that implement theTranslatable
interface and thus have the scopes. The problem I have is I can get theBuilder
model and check withinstanceof
if it implements the interface, or I can also usehasNamedScope
, but PhpStorm keeps complaining that it cannot find the method inBuilder
. Given that PhpStorm is a popular IDE, I thought you guys might have had this issue, too. Do you have any idea how to solve it?Beta Was this translation helpful? Give feedback.
All reactions