| Conditions | 2 |
| Paths | 2 |
| Total Lines | 13 |
| Code Lines | 8 |
| Lines | 0 |
| Ratio | 0 % |
| Tests | 6 |
| CRAP Score | 2.0625 |
| Changes | 0 | ||
| 1 | <?php namespace Arcanedev\LaravelTracker\Trackers; |
||
| 43 | 2 | public function track($cookie) |
|
| 44 | { |
||
| 45 | 2 | if ( ! $cookie) { |
|
| 46 | $this->cookie()->queue( |
||
| 47 | $this->cookie()->make($this->getConfig('cookie.name'), $cookie = (string) Uuid::uuid4()) |
||
| 48 | ); |
||
| 49 | } |
||
| 50 | |||
| 51 | 2 | return $this->getModel() |
|
| 52 | 2 | ->newQuery() |
|
| 53 | 2 | ->firstOrCreate(['uuid' => $cookie]) |
|
| 54 | 2 | ->getKey(); |
|
| 55 | } |
||
| 56 | |||
| 72 |