Using laravels magic with scopes I can typehint the scope name as it is used in the code (hasName). However it will then not be picked up by the IDE, if the scopeHasName is being used and where it is used. Is there some way to "alias" those two. I.e. telling the IDE that "hasName" is actually implemented in "scopeHasName"?
/** @method static Builder hasName(Builder $q) **/
class User extends Model {
public function scopeHasName($q)
{
return $q->whereNotNull('name');
}
}
$user = User::hasName()->first();