-
Notifications
You must be signed in to change notification settings - Fork 131
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
417 additions
and
199 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) | ||
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). | ||
|
||
## [Unreleased] | ||
|
||
## [1.0.0] - 2017-08-29 | ||
### Added | ||
- Ability to set expiration date of promocode while creating. | ||
- Ability to remove all redundant (expired or used) promocodes from database. | ||
- Invalid Promocode Exception, Unauthenticated Exception, Already Used Exception. | ||
- Ability to disable promocode using code string (Promocode will be expired). | ||
- Support for Laravel 5.5 Package Auto-Discovery. | ||
|
||
### Changed | ||
- Migration & config file. Now promocode & user will be related through pivot table. [#12] | ||
|
||
### Fixed | ||
- Migration problem where database couldn't support json type. [#13] | ||
|
||
### Removed | ||
- Ability of user, that they could create promocodes assigned to them. | ||
|
||
[Unreleased]: https://github.com/olivierlacan/keep-a-changelog/compare/v1.0.0...HEAD | ||
[1.0.0]: https://github.com/zgabievi/laravel-promocodes/compare/v0.5.4...v1.0.0 | ||
|
||
[#12]: https://github.com/zgabievi/laravel-promocodes/issues/12 | ||
[#13]: https://github.com/zgabievi/laravel-promocodes/issues/13 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Gabievi\Promocodes\Exceptions; | ||
|
||
use Exception; | ||
|
||
class AlreadyUsedExceprion extends Exception | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $message = 'Promotion code is already used by current user.'; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
protected $code = 403; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Gabievi\Promocodes\Exceptions; | ||
|
||
use Exception; | ||
|
||
class InvalidPromocodeExceprion extends Exception | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $message = 'Invalid promotion code was passed.'; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
protected $code = 404; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?php | ||
|
||
namespace Gabievi\Promocodes\Exceptions; | ||
|
||
use Exception; | ||
|
||
class UnauthenticatedExceprion extends Exception | ||
{ | ||
/** | ||
* @var string | ||
*/ | ||
protected $message = 'User is not authenticated, and can not use promotion code.'; | ||
|
||
/** | ||
* @var int | ||
*/ | ||
protected $code = 401; | ||
} |
Oops, something went wrong.