Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

mstdmstd's avatar

Unclear construction with scope in model request ?

Looking at some laravel examples I found a construction :

 $item = Item::scope()->findOrFail($item_id);

where Item model has no any scopes at all. Why scope method is used here ?

0 likes
2 replies
tykus's avatar
tykus
Best Answer
Level 104

It is not a framework method; does this code actually run without error?

Is there a local scope (scopeScope method) on a base model class that the Item class extends?

1 like

Please or to participate in this conversation.