Skip to content

Commit 43bd646

Browse files
committed
Updated readme file
1 parent cf9b66d commit 43bd646

File tree

1 file changed

+15
-15
lines changed

1 file changed

+15
-15
lines changed

README.md

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,16 @@
55
[![Latest Unstable Version](https://poser.pugx.org/olimortimer/laravelshoppingcart/v/unstable)](https://packagist.org/packages/olimortimer/laravelshoppingcart)
66
[![License](https://poser.pugx.org/olimortimer/laravelshoppingcart/license)](https://packagist.org/packages/olimortimer/laravelshoppingcart)
77

8-
A simple shoppingcart implementation for Laravel.
8+
A simple shoppingcart implementation for Laravel 5, 6 and 7.
99

1010
## Installation
1111

12-
Install the package through [Composer](http://getcomposer.org/).
12+
Install the package through [Composer](http://getcomposer.org/).
1313

1414
Run the Composer require command from the Terminal:
1515

16-
composer require michaelbelgium/shoppingcart
17-
16+
composer require olimortimer/laravelshoppingcart
17+
1818
### Laravel <= 5.4
1919

2020
Should you still be on version 5.4 of Laravel, the final steps for you are to add the service provider of the package and alias the package. To do this open your `config/app.php` file.
@@ -71,8 +71,8 @@ Maybe you prefer to add the item using an array? As long as the array contains t
7171
Cart::add(['id' => '293ad', 'name' => 'Product 1', 'qty' => 1, 'price' => 9.99, 'options' => ['size' => 'large']]);
7272
```
7373

74-
New in version 2 of the package is the possibility to work with the `Buyable` interface. The way this works is that you have a model implement the `Buyable` interface, which will make you implement a few methods so the package knows how to get the id, name and price from your model.
75-
This way you can just pass the `add()` method a model and the quantity and it will automatically add it to the cart.
74+
New in version 2 of the package is the possibility to work with the `Buyable` interface. The way this works is that you have a model implement the `Buyable` interface, which will make you implement a few methods so the package knows how to get the id, name and price from your model.
75+
This way you can just pass the `add()` method a model and the quantity and it will automatically add it to the cart.
7676

7777
**As an added bonus it will automatically associate the model with the CartItem**
7878

@@ -85,7 +85,7 @@ Cart::add($product, 1, ['size' => 'large']);
8585
```
8686

8787
Finally, you can also add multipe items to the cart at once.
88-
You can just pass the `add()` method an array of arrays, or an array of Buyables and they will be added to the cart.
88+
You can just pass the `add()` method an array of arrays, or an array of Buyables and they will be added to the cart.
8989

9090
**When adding multiple items to the cart, the `add()` method will return an array of CartItems.**
9191

@@ -201,7 +201,7 @@ You can set the default number format in the config file.
201201

202202
### Cart::subtotal()
203203

204-
The `subtotal()` method can be used to get the total of all items in the cart, minus the total amount of tax.
204+
The `subtotal()` method can be used to get the total of all items in the cart, minus the total amount of tax.
205205

206206
```php
207207
Cart::subtotal();
@@ -314,7 +314,7 @@ Cart::instance('wishlist')->count();
314314

315315
## Models
316316

317-
Because it can be very convenient to be able to directly access a model from a CartItem is it possible to associate a model with the items in the cart. Let's say you have a `Product` model in your application. With the `associate()` method, you can tell the cart that an item in the cart, is associated to the `Product` model.
317+
Because it can be very convenient to be able to directly access a model from a CartItem is it possible to associate a model with the items in the cart. Let's say you have a `Product` model in your application. With the `associate()` method, you can tell the cart that an item in the cart, is associated to the `Product` model.
318318

319319
That way you can access your model right from the `CartItem`!
320320

@@ -361,22 +361,22 @@ This will give you a `cart.php` config file in which you can make the changes.
361361
To make your life easy, the package also includes a ready to use `migration` which you can publish by running:
362362

363363
php artisan vendor:publish --provider="Gloudemans\Shoppingcart\ShoppingcartServiceProvider" --tag="migrations"
364-
364+
365365
This will place a `shoppingcart` table's migration file into `database/migrations` directory. Now all you have to do is run `php artisan migrate` to migrate your database.
366366

367-
### Storing the cart
367+
### Storing the cart
368368
To store your cart instance into the database, you have to call the `store($identifier) ` method. Where `$identifier` is a random key, for instance the id or username of the user.
369369

370370
Cart::store('username');
371-
371+
372372
// To store a cart instance named 'wishlist'
373373
Cart::instance('wishlist')->store('username');
374374

375375
### Restoring the cart
376376
If you want to retrieve the cart from the database and restore it, all you have to do is call the `restore($identifier)` where `$identifier` is the key you specified for the `store` method.
377-
377+
378378
Cart::restore('username');
379-
379+
380380
// To restore a cart instance named 'wishlist'
381381
Cart::instance('wishlist')->restore('username');
382382

@@ -445,7 +445,7 @@ Cart::addCost('somethingelse', 1.11);
445445
<?php endforeach;?>
446446

447447
</tbody>
448-
448+
449449
<tfoot>
450450
<tr>
451451
<td colspan="2">&nbsp;</td>

0 commit comments

Comments
 (0)