| Conditions | 2 |
| Paths | 2 |
| Total Lines | 11 |
| Code Lines | 7 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0116 |
| Changes | 0 | ||
| 1 | <?php namespace Arcanedev\LaravelTracker\Trackers; |
||
| 51 | 9 | public function track($ipAddress) |
|
| 52 | { |
||
| 53 | 9 | if ($data = $this->getGeoIpDetector()->search($ipAddress)) { |
|
| 54 | 9 | return $this->getModel() |
|
| 55 | 9 | ->newQuery() |
|
| 56 | 9 | ->firstOrCreate(Arr::only($data, ['latitude', 'longitude']), $data) |
|
| 57 | 9 | ->getKey(); |
|
| 58 | } |
||
| 59 | |||
| 60 | return null; |
||
| 61 | } |
||
| 62 | } |
||
| 63 |