@@ -68,15 +68,13 @@ composer require matanyadaev/laravel-eloquent-spatial
68
68
namespace App\Models;
69
69
70
70
use Illuminate\Database\Eloquent\Model;
71
- use MatanYadaev\EloquentSpatial\SpatialBuilder;
72
71
use MatanYadaev\EloquentSpatial\Objects\Point;
73
72
use MatanYadaev\EloquentSpatial\Objects\Polygon;
74
73
use MatanYadaev\EloquentSpatial\Traits\HasSpatial;
75
74
76
75
/**
77
76
* @property Point $location
78
77
* @property Polygon $area
79
- * @method static SpatialBuilder query()
80
78
*/
81
79
class Place extends Model
82
80
{
@@ -150,39 +148,6 @@ echo $vacationCity->area->toJson(); // {"type":"Polygon","coordinates":[[[41.907
150
148
151
149
For more comprehensive documentation on the API, please refer to the [ API] ( API.md ) page.
152
150
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
-
186
151
## Extension
187
152
188
153
You can add new methods to the ` Geometry ` class through macros.
@@ -219,6 +184,8 @@ Here are some useful commands for development:
219
184
* Perform type checking: ` composer phpstan `
220
185
* Format your code: ` composer php-cs-fixer `
221
186
187
+ Before running tests, make sure to run ` docker-compose up ` to start the database container.
188
+
222
189
## Updates and Changes
223
190
224
191
For details on updates and changes, please refer to our [ CHANGELOG] ( CHANGELOG.md ) .
0 commit comments