Skip to content

Commit

Permalink
Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
cjonstrup committed Sep 21, 2017
1 parent 998174f commit 64d80e8
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 4 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ To use, simply install the package via Composer and then add the following to yo

```php
'Lenius\Basket\BasketServiceProvider',

'Basket' => Lenius\basket\Facades\Basket::class,
```

You should then be good to go and be able to access the basket using the following static interface:
Expand Down
17 changes: 13 additions & 4 deletions src/Lenius/Basket/Storage/LaravelSession.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,14 @@
namespace Lenius\Basket\Storage;

use Lenius\Basket\Item;
use Illuminate\Support\Facades\Session;
use Lenius\Basket\StorageInterface;


class LaravelSession implements \Lenius\Basket\StorageInterface
/**
* @property string id
*/
class LaravelSession implements StorageInterface
{
protected $identifier;
protected static $cart = array();
Expand All @@ -50,7 +55,8 @@ public function insertUpdate(Item $item)

/**
* Retrieve the cart data
*
*
* @param bool $asArray
* @return array
*/
public function &data($asArray = false)
Expand Down Expand Up @@ -90,7 +96,7 @@ public function has($identifier)
* Get a single cart item by id
*
* @param mixed $identifier
* @return Item The item class
* @return bool|Item
* @internal param mixed $id The item id
*/
public function item($identifier)
Expand All @@ -108,7 +114,7 @@ public function item($identifier)
* Returns the first occurance of an item with a given id
*
* @param string $id The item id
* @return Item Item object
* @return bool|Item
*/
public function find($id)
{
Expand Down Expand Up @@ -173,6 +179,9 @@ public function getIdentifier()
return $this->identifier;
}

/**
* Save Cart
*/
protected function saveCart()
{
$data = static::$cart;
Expand Down

0 comments on commit 64d80e8

Please sign in to comment.