Conditions | 2 |
Paths | 2 |
Total Lines | 9 |
Code Lines | 5 |
Lines | 0 |
Ratio | 0 % |
Tests | 4 |
CRAP Score | 2.032 |
Changes | 0 |
1 | <?php namespace Arcanedev\LaravelTracker\Trackers; |
||
49 | 18 | public function track($ipAddress) |
|
50 | { |
||
51 | 18 | if ($data = $this->getGeoIpDetector()->search($ipAddress)) { |
|
52 | 18 | return $this->getModel() |
|
53 | 18 | ->firstOrCreate(Arr::only($data, ['latitude', 'longitude']), $data)->id; |
|
54 | } |
||
55 | |||
56 | return null; |
||
57 | } |
||
58 | } |
||
59 |