| 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; |
||
| 48 | 12 | public function track($ipAddress) |
|
| 49 | { |
||
| 50 | 12 | if ($data = $this->geoIpDetector->search($ipAddress)) { |
|
| 51 | 6 | $model = GeoIp::firstOrCreate(Arr::only($data, ['latitude', 'longitude']), $data); |
|
| 52 | |||
| 53 | 6 | return $model->id; |
|
| 54 | } |
||
| 55 | |||
| 56 | 6 | return null; |
|
| 57 | } |
||
| 58 | } |
||
| 59 |