Code Coverage |
||||||||||
Classes and Traits |
Functions and Methods |
Lines |
||||||||
Total | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
CRAP | |
100.00% |
2 / 2 |
Location | |
100.00% |
1 / 1 |
|
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
getCoordinatesAttribute | |
100.00% |
1 / 1 |
1 | |
100.00% |
2 / 2 |
1 | <?php |
2 | |
3 | namespace Qmp\Laravel\Geolocation\Models; |
4 | |
5 | class Location extends \Moloquent |
6 | { |
7 | |
8 | protected $connection = 'geolocationMongo'; |
9 | protected $collection = 'locations'; |
10 | protected $guarded = ['_id']; |
11 | protected $hidden = ['_id']; |
12 | |
13 | /** |
14 | * Get coordinates (Lat, Lon) |
15 | * |
16 | * @return array |
17 | */ |
18 | public function getCoordinatesAttribute() |
19 | { |
20 | return [ |
21 | 'lat' => $this->lat, |
22 | 'lon' => $this->lon |
23 | ]; |
24 | } |
25 | |
26 | |
27 | |
28 | } |