Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Laravel 10 Support #109

Open
wants to merge 3 commits into
base: release/9.0
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,19 +16,19 @@
],
"require": {
"php": "^8.1",
"illuminate/support": "^9.0",
"illuminate/console": "^9.0",
"illuminate/database": "^9.0",
"illuminate/broadcasting": "^9.0",
"illuminate/queue": "^9.0",
"illuminate/container": "^9.0"
"illuminate/support": "^9.0|^10.0",
"illuminate/console": "^9.0|^10.0",
"illuminate/database": "^9.0|^10.0",
"illuminate/broadcasting": "^9.0|^10.0",
"illuminate/queue": "^9.0|^10.0",
"illuminate/container": "^9.0|^10.0"
},
"require-dev": {
"phpunit/phpunit": "^9.0",
"orchestra/testbench": "^7.1",
"pestphp/pest": "^1.21",
"pestphp/pest-plugin-laravel": "^1.2",
"pestphp/pest-plugin-mock": "^1.0",
"phpunit/phpunit": "^9.0|^10.1",
"orchestra/testbench": "^7.1|^8.5",
"pestphp/pest": "^1.21|2.8",
"pestphp/pest-plugin-laravel": "^1.2|^2.0",
"pestphp/pest-plugin-mock": "^1.0|^2.0",
"nunomaduro/larastan": "^2.0"
},
"autoload": {
Expand Down
6 changes: 4 additions & 2 deletions src/Promocodes.php
Original file line number Diff line number Diff line change
Expand Up @@ -251,9 +251,11 @@ public function apply(): ?PromocodeContract
event(new GuestAppliedPromocode($this->promocode));
}

$this->promocode->decrement('usages_left');
if (!$this->promocode->isUnlimited()) {
$this->promocode->decrement('usages_left');
}
Elshaden marked this conversation as resolved.
Show resolved Hide resolved

return $this->promocode;
return $this->promocode;
}

/**
Expand Down