File tree Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Expand file tree Collapse file tree 1 file changed +30
-0
lines changed Original file line number Diff line number Diff line change @@ -137,6 +137,36 @@ Please see [API](API.md) for more informative API documentation.
137137
138138## Tip for better IDE support
139139
140+ For better IDE support, you should add a ` query ` method phpDoc annotation to your model:
141+
142+ ``` php
143+ /**
144+ * @method static SpatialBuilder query()
145+ */
146+ class Place extends Model
147+ {
148+ // ...
149+ }
150+ ```
151+
152+ Or alternatively override the method:
153+
154+ ``` php
155+ class Place extends Model
156+ {
157+ public static function query(): SpatialBuilder
158+ {
159+ return parent::query();
160+ }
161+ }
162+ ```
163+
164+ In order to get IDE auto-complete you should create queries only with the ` query() ` static method:
165+
166+ ``` php
167+ Place::query()->whereDistance(...); // This is IDE-friendly
168+ Place::whereDistance(...); // This is not
169+ ```
140170
141171## Tests
142172
You can’t perform that action at this time.
0 commit comments