Skip to content

Are global query scopes supported by larastan? #1161

Answered by canvural
dweidner asked this question in Q&A
Discussion options

You must be logged in to vote

Hi,

The errors you show are from the scope class itself, not from anywhere that the scope is used. So I think it's safe to ignore errors coming from the scope itself. Fixing those can be tricky because you'd need to provide the real models that using this scope, in the PHPDocs. Call to an undefined method Illuminate\Database\Eloquent\Model::getQualifiedExpiresAtColumn(). happens because in fact that method does not exists in Illuminate\Database\Eloquent\Model But for example it might exist in App\Models\Foo

Global scopes are not directly supported by Larastan and the only way to add support is like you did with adding those PHPDocs to the trait. And I think better docs would be something …

Replies: 3 comments 7 replies

Comment options

You must be logged in to vote
1 reply
@dweidner
Comment options

Answer selected by canvural
Comment options

You must be logged in to vote
4 replies
@calebdw
Comment options

@calebdw
Comment options

@szepeviktor
Comment options

@calebdw
Comment options

Comment options

You must be logged in to vote
2 replies
@Indemnity83
Comment options

@calebdw
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants