| Conditions | 2 |
| Paths | 2 |
| Total Lines | 10 |
| Code Lines | 5 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 5 |
| CRAP Score | 2 |
| Changes | 0 | ||
| 1 | <?php namespace Arcanedev\LaravelTracker\Trackers; |
||
| 39 | 12 | public function track($ipAddress) |
|
| 40 | { |
||
| 41 | 12 | if ($data = $this->getGeoIpDetector()->search($ipAddress)) { |
|
| 42 | 6 | $model = GeoIp::firstOrCreate(Arr::only($data, ['latitude', 'longitude']), $data); |
|
| 43 | |||
| 44 | 6 | return $model->id; |
|
| 45 | } |
||
| 46 | |||
| 47 | 6 | return null; |
|
| 48 | } |
||
| 49 | } |
||
| 50 |