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