| Conditions | 2 |
| Paths | 2 |
| Total Lines | 12 |
| Code Lines | 6 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 0 |
| CRAP Score | 6 |
| Changes | 0 | ||
| 1 | <?php namespace Arcanedev\LaravelTracker\Trackers; |
||
| 45 | public function track($ipAddress) |
||
| 46 | { |
||
| 47 | $data = $this->detector->search($ipAddress); |
||
| 48 | |||
| 49 | if ($data) { |
||
| 50 | $model = GeoIp::firstOrCreate(Arr::only($data, ['latitude', 'longitude']), $data); |
||
| 51 | |||
| 52 | return $model->id; |
||
| 53 | } |
||
| 54 | |||
| 55 | return null; |
||
| 56 | } |
||
| 57 | } |
||
| 58 |