Skip to content
This repository was archived by the owner on Feb 17, 2022. It is now read-only.

Commit 63b21df

Browse files
author
Robert Kummer
committed
refactored get and forget to pull
1 parent c977fd6 commit 63b21df

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

composer.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "ipunkt/laravel-analytics",
33
"type": "library",
4-
"description": "Analytics tracking for laravel 4.x",
4+
"description": "Analytics tracking for Laravel",
55
"keywords": ["analytics", "google analytics", "laravel", "statistics", "javascript", "php"],
66
"license": "MIT",
77
"authors": [
@@ -12,7 +12,8 @@
1212
],
1313
"require": {
1414
"php": ">=5.4.0",
15-
"illuminate/support": "~4.0"
15+
"illuminate/support": "~4.0",
16+
"illuminate/session": "~4.0"
1617
},
1718
"autoload": {
1819
"psr-0": {

src/Ipunkt/LaravelAnalytics/TrackingBag.php

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,7 @@ public function add($tracking)
3939
public function get()
4040
{
4141
if (Session::has($this->sessionIdentifier)) {
42-
$trackings = Session::get($this->sessionIdentifier);
43-
44-
// forget the session store data
45-
Session::forget($this->sessionIdentifier);
46-
47-
return $trackings;
42+
return Session::pull($this->sessionIdentifier);
4843
}
4944

5045
return [];

0 commit comments

Comments
 (0)