@@ -68,15 +68,13 @@ composer require matanyadaev/laravel-eloquent-spatial
6868 namespace App\Models;
6969
7070 use Illuminate\Database\Eloquent\Model;
71- use MatanYadaev\EloquentSpatial\SpatialBuilder;
7271 use MatanYadaev\EloquentSpatial\Objects\Point;
7372 use MatanYadaev\EloquentSpatial\Objects\Polygon;
7473 use MatanYadaev\EloquentSpatial\Traits\HasSpatial;
7574
7675 /**
7776 * @property Point $location
7877 * @property Polygon $area
79- * @method static SpatialBuilder query()
8078 */
8179 class Place extends Model
8280 {
@@ -150,39 +148,6 @@ echo $vacationCity->area->toJson(); // {"type":"Polygon","coordinates":[[[41.907
150148
151149For more comprehensive documentation on the API, please refer to the [ API] ( API.md ) page.
152150
153- ## Tips for Improving IDE Support
154-
155- In order to get better IDE support, you can add a ` query ` method phpDoc annotation to your model:
156-
157- ``` php
158- /**
159- * @method static SpatialBuilder query()
160- */
161- class Place extends Model
162- {
163- // ...
164- }
165- ```
166-
167- Or you could override the method:
168-
169- ``` php
170- class Place extends Model
171- {
172- public static function query(): SpatialBuilder
173- {
174- return parent::query();
175- }
176- }
177- ```
178-
179- Create queries only with the ` query() ` static method:
180-
181- ``` php
182- Place::query()->whereDistance(...); // This is IDE-friendly
183- Place::whereDistance(...); // This is not
184- ```
185-
186151## Extension
187152
188153You can add new methods to the ` Geometry ` class through macros.
@@ -219,6 +184,8 @@ Here are some useful commands for development:
219184* Perform type checking: ` composer phpstan `
220185* Format your code: ` composer php-cs-fixer `
221186
187+ Before running tests, make sure to run ` docker-compose up ` to start the database container.
188+
222189## Updates and Changes
223190
224191For details on updates and changes, please refer to our [ CHANGELOG] ( CHANGELOG.md ) .
0 commit comments