Skip to content

Commit f4af457

Browse files
Support: Laravel 9.X (#36)
1 parent 146d40d commit f4af457

File tree

7 files changed

+18
-13
lines changed

7 files changed

+18
-13
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ All notable changes to this project will be documented in this file.
44
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
55
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
66

7+
## [1.5.0] - 2022-02-12
8+
### Added
9+
- Support for Laravel 9.x
10+
711
## [1.4.2] - 2020-02-13
812
### Added
913
- New method cartItemQuantitySet() to update quantity of a cart item directly.

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Contributions are **welcome** and will be fully **credited**. We accept contribu
55
## Pull Requests
66

77
- **Add tests!** Your patch won't be accepted if it doesn't have tests.
8-
- **Document any change in behaviour.** Make sure the `README.md` and any other relevant documentation are kept up-to-date.
8+
- **Document any change in behavior.** Make sure the `README.md` and any other relevant documentation are kept up-to-date.
99
- **Consider our release cycle.** We try to follow [SemVer v2.0.0](http://semver.org/). Randomly breaking public APIs is not an option.
1010
- **Create feature branches.** Don't ask us to pull from your master branch.
1111
- **One pull request per feature.** If you want to do more than one thing, send multiple pull requests.

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
[![StyleCI](https://styleci.io/repos/115199831/shield?branch=master)](https://styleci.io/repos/115199831)
55
[![Buy us a tree](https://img.shields.io/badge/Buy%20me%20a%20tree-%F0%9F%8C%B3-lightgreen?style=flat-square)](https://plant.treeware.earth/freshbitsweb/laravel-cart-manager)
66

7-
# Cart Manager (Laravel 5.5 to Laravel 8.x)
7+
# Cart Manager (Laravel 5.5 to Laravel 9.x)
88
Let's make the cart management with Laravel a breeze.
99

1010
## Just another shopping cart package?
@@ -22,6 +22,7 @@ Let us decide when this package should be used:
2222
## Requirements
2323
| PHP | Laravel | Package |
2424
|--------|---------|---------|
25+
| 8.0+ | 9.x | v1.5.0 |
2526
| 7.3+ | 8.x | v1.4.0 |
2627
| <7.3 | 7.x | v1.3.0 |
2728
| <7.2.5 | 6.x | v1.2.0 |

composer.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@
44
"require": {
55
"php": "^7.3|^7.4|^8.0",
66
"ext-intl": "*",
7-
"illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0"
7+
"illuminate/support": "5.5.*|5.6.*|5.7.*|5.8.*|^6.0|^7.0|^8.0|^9.0"
88
},
99
"require-dev": {
1010
"phpunit/phpunit": "^9.3.9",
11-
"orchestra/testbench": "^6.15.1",
12-
"laravel/legacy-factories": "^1.0.4"
11+
"orchestra/testbench": "^6.23|^7.0.0",
12+
"laravel/legacy-factories": "^1.3.0"
1313
},
1414
"license": "MIT",
1515
"authors": [

database/migrations/2017_12_21_120348_create_carts_table.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
class CreateCartsTable extends Migration
8-
{
7+
return new class extends Migration {
98
/**
109
* Run the migrations.
1110
*
@@ -40,4 +39,4 @@ public function down()
4039
{
4140
Schema::dropIfExists('carts');
4241
}
43-
}
42+
};

database/migrations/2017_12_21_120815_create_cart_items_table.php

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,7 @@
44
use Illuminate\Database\Schema\Blueprint;
55
use Illuminate\Support\Facades\Schema;
66

7-
class CreateCartItemsTable extends Migration
8-
{
7+
return new class extends Migration {
98
/**
109
* Run the migrations.
1110
*
@@ -35,4 +34,4 @@ public function down()
3534
{
3635
Schema::dropIfExists('cart_items');
3736
}
38-
}
37+
};

src/Traits/Discountable.php

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,12 @@
88
trait Discountable
99
{
1010
/**
11-
* Applies disount to the cart.
11+
* Applies discount to the cart.
1212
*
1313
* @param float Discount Percentage
1414
* @param int Coupon id
1515
* @return array
16+
*
1617
* @throws IncorrectDiscount
1718
*/
1819
public function applyDiscount($percentage, $couponId = null)
@@ -37,11 +38,12 @@ public function applyDiscount($percentage, $couponId = null)
3738
}
3839

3940
/**
40-
* Applies flat disount to the cart.
41+
* Applies flat discount to the cart.
4142
*
4243
* @param float Discount amount
4344
* @param int Coupon id
4445
* @return array
46+
*
4547
* @throws IncorrectDiscount
4648
*/
4749
public function applyFlatDiscount($amount, $couponId = null)

0 commit comments

Comments
 (0)