From 3845ce0ccfed481ddaf499e2a8da71c8b9985fbb Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 25 Aug 2020 15:52:17 +0100 Subject: [PATCH 01/22] update to laravel 7 --- .phpunit.result.cache | 1 + composer.json | 20 +++++++++---------- .../2018_01_01_000000_create_plans_tables.php | 0 src/Period.php | 2 +- tests/TestCase.php | 11 +++++----- 5 files changed, 18 insertions(+), 16 deletions(-) create mode 100644 .phpunit.result.cache mode change 100644 => 100755 resources/migrations/2018_01_01_000000_create_plans_tables.php diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 0000000..3b5fe5f --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +C:37:"PHPUnit\Runner\DefaultTestResultCache":3809:{a:2:{s:7:"defects";a:19:{s:82:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCreateAFeature";i:4;s:86:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCalculateResetTime";i:4;s:93:"Laravel\PricingPlans\Tests\Integration\Models\PlanTest::testItCanCreateAPlanAndAttachFeatures";i:4;s:84:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanGetAllIntervalsWithTranslations";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #0";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #1";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #2";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #3";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #4";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #5";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #6";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #7";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #8";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #9";i:4;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #10";i:4;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #11";i:4;s:83:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriodWithEmptyStart";i:4;s:81:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItThrowExceptionOnInvalidInterval";i:4;s:73:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanValidateIntervalUnit";i:4;}s:5:"times";a:19:{s:82:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCreateAFeature";d:0.556;s:86:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCalculateResetTime";d:0.389;s:93:"Laravel\PricingPlans\Tests\Integration\Models\PlanTest::testItCanCreateAPlanAndAttachFeatures";d:0.461;s:84:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanGetAllIntervalsWithTranslations";d:0.391;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #0";d:0.37;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #1";d:0.369;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #2";d:0.372;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #3";d:0.371;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #4";d:0.379;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #5";d:0.374;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #6";d:0.386;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #7";d:0.368;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #8";d:0.393;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #9";d:0.424;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #10";d:0.407;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #11";d:0.421;s:83:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriodWithEmptyStart";d:0.408;s:81:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItThrowExceptionOnInvalidInterval";d:0.431;s:73:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanValidateIntervalUnit";d:0.423;}}} \ No newline at end of file diff --git a/composer.json b/composer.json index 5a7feeb..8baf4bf 100644 --- a/composer.json +++ b/composer.json @@ -26,18 +26,18 @@ } }, "require": { - "php": ">=7.0", - "illuminate/database": "~5.4", - "illuminate/support": "~5.4", - "nesbot/carbon": "~1.21" + "php": "^7.2.5", + "illuminate/database": "^7.25", + "illuminate/support": "^7.0", + "nesbot/carbon": "^2.39" }, "require-dev": { - "fzaninotto/faker": "^1.4", - "mockery/mockery": "^0.9", - "orchestra/database": "^3.4", - "orchestra/testbench": "^3.4", - "phpunit/phpunit": "~6.1|~7.0", - "squizlabs/php_codesniffer": "^3.0" + "fzaninotto/faker": "~1.9.1", + "mockery/mockery": "^1.3.1", + "orchestra/database": "5.x-dev", + "orchestra/testbench": "^5.4", + "phpunit/phpunit": "~8.5", + "squizlabs/php_codesniffer": "^3.5" }, "scripts": { "phpunit": "php vendor/phpunit/phpunit/phpunit --coverage-html build/coverage", diff --git a/resources/migrations/2018_01_01_000000_create_plans_tables.php b/resources/migrations/2018_01_01_000000_create_plans_tables.php old mode 100644 new mode 100755 diff --git a/src/Period.php b/src/Period.php index 2fcb6ba..87ea1c3 100644 --- a/src/Period.php +++ b/src/Period.php @@ -161,7 +161,7 @@ public static function getAllIntervals() $intervals = []; foreach (array_keys(self::$intervalMapping) as $interval) { - $intervals[$interval] = Lang::trans('plans::messages.' . $interval); + $intervals[$interval] = Lang::get('plans::messages.' . $interval); } return $intervals; diff --git a/tests/TestCase.php b/tests/TestCase.php index 4086c10..c105146 100644 --- a/tests/TestCase.php +++ b/tests/TestCase.php @@ -17,7 +17,7 @@ class TestCase extends Testbench * * @throws \Exception */ - public function setUp() + public function setUp(): void { parent::setUp(); @@ -25,10 +25,11 @@ public function setUp() $this->loadLaravelMigrations('testbench'); // Run package migrations - $this->loadMigrationsFrom([ - '--database' => 'testbench', - '--realpath' => realpath(__DIR__ . '/../resources/migrations'), - ]); + // $this->loadMigrationsFrom([ + // '--database' => 'testbench', + // '--realpath' => realpath(__DIR__ . '/../resources/migrations'), + // ]); + $this->loadMigrationsFrom(realpath(__DIR__ . '/../resources/migrations')); } /** From e7b3ef6bc024073b8bad0a27dd9fd31c810382ee Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 25 Aug 2020 15:52:48 +0100 Subject: [PATCH 02/22] update to laravel 7 --- .phpunit.result.cache | 1 - 1 file changed, 1 deletion(-) delete mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache deleted file mode 100644 index 3b5fe5f..0000000 --- a/.phpunit.result.cache +++ /dev/null @@ -1 +0,0 @@ -C:37:"PHPUnit\Runner\DefaultTestResultCache":3809:{a:2:{s:7:"defects";a:19:{s:82:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCreateAFeature";i:4;s:86:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCalculateResetTime";i:4;s:93:"Laravel\PricingPlans\Tests\Integration\Models\PlanTest::testItCanCreateAPlanAndAttachFeatures";i:4;s:84:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanGetAllIntervalsWithTranslations";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #0";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #1";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #2";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #3";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #4";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #5";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #6";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #7";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #8";i:4;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #9";i:4;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #10";i:4;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #11";i:4;s:83:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriodWithEmptyStart";i:4;s:81:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItThrowExceptionOnInvalidInterval";i:4;s:73:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanValidateIntervalUnit";i:4;}s:5:"times";a:19:{s:82:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCreateAFeature";d:0.556;s:86:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCalculateResetTime";d:0.389;s:93:"Laravel\PricingPlans\Tests\Integration\Models\PlanTest::testItCanCreateAPlanAndAttachFeatures";d:0.461;s:84:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanGetAllIntervalsWithTranslations";d:0.391;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #0";d:0.37;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #1";d:0.369;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #2";d:0.372;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #3";d:0.371;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #4";d:0.379;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #5";d:0.374;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #6";d:0.386;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #7";d:0.368;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #8";d:0.393;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #9";d:0.424;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #10";d:0.407;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #11";d:0.421;s:83:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriodWithEmptyStart";d:0.408;s:81:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItThrowExceptionOnInvalidInterval";d:0.431;s:73:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanValidateIntervalUnit";d:0.423;}}} \ No newline at end of file From 4c420ec2c8be7b0aabbc918e4fae4cb08c461bb2 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 25 Aug 2020 15:57:41 +0100 Subject: [PATCH 03/22] update to laravel 7 --- README.md | 416 +----------------------------------------------------- 1 file changed, 6 insertions(+), 410 deletions(-) diff --git a/README.md b/README.md index fd627bf..0139ac6 100644 --- a/README.md +++ b/README.md @@ -5,63 +5,18 @@ [![Latest Version](https://img.shields.io/github/release/oanhnn/laravel-pricing-plans.svg?style=flat-square)](https://github.com/oanhnn/laravel-pricing-plans/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -Easy provide pricing plans for Your Laravel 5.4+ Application. +Easy provide pricing plans for Your Laravel 7 Application. Update of oanhnn/laravel-pricing-plans - - -- [Main features](#main-features) -- [TODO](#todo) -- [Requirements](#requirements) -- [Installation](#installation) - - [Composer](#composer) - - [Service Provider](#service-provider) - - [Config file and Migrations](#config-file-and-migrations) - - [Contract and Traits](#contract-and-traits) -- [Config File](#config-file) -- [Models](#models) - - [Feature model](#feature-model) - - [Plan model](#plan-model) - - [PlanFeature model](#planfeature-model) - - [PlanSubscription model](#plansubscription-model) - - [PlanSubscriptionUsage model](#plansubscriptionusage-model) -- [Events](#events) - - [SubscriptionRenewed event](#subscriptionrenewed-event) - - [SubscriptionCanceled event](#subscriptioncanceled-event) - - [SubscriptionPlanChanged event](#subscriptionplanchanged-event) -- [Usage](#usage) - - [Create features and plan](#create-features-and-plan) - - [Creating subscriptions](#creating-subscriptions) - - [Subscription Ability](#subscription-ability) - - [Record Feature Usage](#record-feature-usage) - - [Reduce Feature Usage](#reduce-feature-usage) - - [Clear The Subscription Usage Data](#clear-the-subscription-usage-data) - - [Check Subscription Status](#check-subscription-status) - - [Renew a Subscription](#renew-a-subscription) - - [Cancel a Subscription](#cancel-a-subscription) - - [Scopes](#scopes) -- [Changelog](#changelog) -- [Testing](#testing) -- [Contributing](#contributing) -- [Security](#security) -- [Credits](#credits) -- [License](#license) - - ## Main features -Easy provide pricing plans for Your Laravel 5.4+ Application. - -## TODO +Easy provide pricing plans for Your Laravel 7+ Application. -- [ ] Caching some select query -- [ ] Add unit test scripts -- [ ] Make better documents ## Requirements -* php >=7.0 -* Laravel 5.4+ +* php >=7.2 +* Laravel 7.0+ ## Installation @@ -70,355 +25,9 @@ Easy provide pricing plans for Your Laravel 5.4+ Application. Begin by pulling in the package through Composer. ```bash -$ composer require oanhnn/laravel-pricing-plans -``` - -### Service Provider - -Next, if using Laravel 5.5+, you done. If using Laravel 5.4, you must include the service provider within your `config/app.php` file. - -```php -// config/app.php - - 'providers' => [ - // Other service providers... - - Laravel\PricingPlans\PricingPlansServiceProvider::class, - ], -``` - -### Config file and Migrations - -Publish package config file and migrations with the command: - -```bash -$ php artisan vendor:publish --provider="Laravel\PricingPlans\PricingPlansServiceProvider" -``` - -Then run migrations: - -```bash -$ php artisan migrate -``` - -### Contract and Traits - -Add `Laravel\PricingPlans\Contacts\Subscriber` contract and `Laravel\PricingPlans\Models\Concerns\Subscribable` trait -to your subscriber model (Eg. `User`). - -See the following example: - -```php - 'Upload images', - 'code' => 'upload-images', - 'description' => null, - 'interval_unit' => 'day', - 'interval_count' => 1, - 'sort_order' => 1, -]); - -$feature2 = Feature::create([ - 'name' => 'upload video', - 'code' => 'upload-video', - 'description' => null, - 'interval_unit' => 'day', - 'interval_count' => 1, - 'sort_order' => 2, -]); - -$plan = Plan::create([ - 'name' => 'Pro', - 'code' => 'pro', - 'description' => 'Pro plan', - 'price' => 9.99, - 'interval_unit' => 'month', - 'interval_count' => 1, - 'trial_period_days' => 5, - 'sort_order' => 1, -]); - -$plan->features()->attach([ - $feature1->id => ['value' => 5, 'note' => 'Can upload maximum 5 images daily'], - $feature2->id => ['value' => 1, 'note' => 'Can upload maximum 1 video daily'], -]); -``` - -### Creating subscriptions - -You can subscribe a user to a plan by using the `newSubscription()` function available in the `Subscribable` trait. -First, retrieve an instance of your subscriber model, which typically will be your user model and an instance of the plan -your user is subscribing to. Once you have retrieved the model instance, you may use the `newSubscription` method -to create the model's subscription. - -```php -firstOrFail(); - -$user->newSubscription('main', $plan)->create(); -``` - -The first argument passed to `newSubscription` method should be the name of the subscription. If your application offer -a single subscription, you might call this `main` or `primary`. The second argument is the plan instance your user is subscribing to. - - - - - -### Subscription Ability - -There's multiple ways to determine the usage and ability of a particular feature in the user subscription, the most common one is `canUse`: - -The `canUse` method returns `true` or `false` depending on multiple factors: - -- Feature _is enabled_. -- Feature value isn't `0`. -- Or feature has remaining uses available. - -```php -$user->subscription('main')->ability()->canUse(Feature::FEATURE_UPLOAD_IMAGES); -``` - -Other methods are: - -- `enabled`: returns `true` when the value of the feature is a _positive word_ listed in the config file. -- `consumed`: returns how many times the user has used a particular feature. -- `remainings`: returns available uses for a particular feature. -- `value`: returns the feature value. - -> All methods share the same signature: e.g. ->`$user->subscription('main')->ability()->consumed(Feature::FEATURE_UPLOAD_IMAGES);`. - - -### Record Feature Usage - -In order to efectively use the ability methods you will need to keep track of every usage of each feature -(or at least those that require it). You may use the `record` method available through the user `subscriptionUsage()` -method: - -```php -$user->subscriptionUsage('main')->record(Feature::FEATURE_UPLOAD_IMAGES); -``` - -The `record` method accept 3 parameters: the first one is the feature's code, the second one is the quantity of -uses to add (default is `1`), and the third one indicates if the addition should be incremental (default behavior), -when disabled the usage will be override by the quantity provided. E.g.: - -```php -// Increment by 2 -$user->subscriptionUsage('main')->record(Feature::FEATURE_UPLOAD_IMAGES, 2); - -// Override with 9 -$user->subscriptionUsage('main')->record(Feature::FEATURE_UPLOAD_IMAGES, 9, false); -``` - -### Reduce Feature Usage - -Reducing the feature usage is _almost_ the same as incrementing it. Here we only _substract_ a given quantity (default is `1`) -to the actual usage: - -```php -$user->subscriptionUsage('main')->reduce(Feature::FEATURE_UPLOAD_IMAGES, 2); -``` - -### Clear The Subscription Usage Data - -```php -$user->subscriptionUsage('main')->clear(); -``` - -### Check Subscription Status - -For a subscription to be considered active _one of the following must be `true`_: - -- Subscription has an active trial. -- Subscription `ends_at` is in the future. - -```php -$user->subscribed('main'); -$user->subscribed('main', $planId); // Check if user is using a particular plan -``` - -Alternatively you can use the following methods available in the subscription model: - -```php -$user->subscription('main')->isActive(); -$user->subscription('main')->isCanceled(); -$user->subscription('main')->isCanceledImmediately(); -$user->subscription('main')->isEnded(); -$user->subscription('main')->onTrial(); -``` - -> Canceled subscriptions with an active trial or `ends_at` in the future are considered active. - -### Renew a Subscription - -To renew a subscription you may use the `renew` method available in the subscription model. -This will set a new `ends_at` date based on the selected plan and _will clear the usage data_ of the subscription. - -```php -$user->subscription('main')->renew(); -``` - -_Canceled subscriptions with an ended period can't be renewed._ - -### Cancel a Subscription - -To cancel a subscription, simply use the `cancel` method on the user's subscription: - -```php -$user->subscription('main')->cancel(); -``` - -By default the subscription will remain active until the end of the period, you may pass `true` to end the subscription _immediately_: - -```php -$user->subscription('main')->cancel(true); -``` - -### Scopes - -#### Subscription Model -```php -get(); - -// Get subscription by subscriber: -$subscription = PlanSubscription::bySubscriber($user)->first(); - -// Get subscriptions with trial ending in 3 days: -$subscriptions = PlanSubscription::findEndingTrial(3)->get(); - -// Get subscriptions with ended trial: -$subscriptions = PlanSubscription::findEndedTrial()->get(); - -// Get subscriptions with period ending in 3 days: -$subscriptions = PlanSubscription::findEndingPeriod(3)->get(); - -// Get subscriptions with ended period: -$subscriptions = PlanSubscription::findEndedPeriod()->get(); -``` - -## Changelog - -See all change logs in [CHANGELOG](CHANGELOG.md) ## Testing @@ -429,25 +38,12 @@ $ composer install $ composer phpunit ``` -## Contributing - -Please see [CONTRIBUTING](CONTRIBUTING.md) for details. - -## Security - -If you discover any security related issues, please email to [Oanh Nguyen](mailto:oanhnn.bk@gmail.com) instead of -using the issue tracker. ## Credits -I forked and recreated this project from [gerardojbaez/laraplans](https://github.com/gerardojbaez/laraplans) project in mid-2017. -Thank [Gerardo Baez](https://github.com/gerardojbaez) +I forked and updated this project to support laravel 7 from [oanhnn/laravel-pricing-plans](https://github.com/oanhnn/laravel-pricing-plans) project in mid-2020. -- [Oanh Nguyen](https://github.com/oanhnn) -- [Gerardo Baez](https://github.com/gerardojbaez) -- [All Contributors](../../contributors) ## License This project is released under the MIT License. -Copyright © 2017-2018 [Oanh Nguyen](https://oanhnn.github.io/). From d78310abcb5fc8c3870a8017c7bfc204236a5672 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 25 Aug 2020 16:01:30 +0100 Subject: [PATCH 04/22] update to laravel 7 --- composer.json | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/composer.json b/composer.json index 8baf4bf..904ed01 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { - "name": "oanhnn/laravel-pricing-plans", + "name": "andychukse/laravel-pricing-plans", "type": "library", - "description": "A package provide pricing plans for Laravel.", + "description": "A package provide pricing plans for Laravel. Forked from oanhnn/laravel-pricing-plans", "keywords": [ "plans", "laravel", @@ -9,10 +9,10 @@ "pricing" ], "license": "MIT", - "homepage": "https://github.com/oanhnn/laravel-pricing-plans", + "homepage": "https://github.com/andychukse/laravel-pricing-plans", "support": { - "issues": "https://github.com/oanhnn/laravel-pricing-plans/issues", - "source": "https://github.com/oanhnn/laravel-pricing-plans" + "issues": "https://github.com/andychukse/laravel-pricing-plans/issues", + "source": "https://github.com/andychukse/laravel-pricing-plans" }, "authors": [ { From 8491c2c9f34ae03c395ad2f7efdeb07a498b797f Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 25 Aug 2020 18:00:01 +0100 Subject: [PATCH 05/22] update to laravel 7 --- CHANGELOG.md | 97 ++-------------------------------------------------- 1 file changed, 3 insertions(+), 94 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6936570..6923f7e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,98 +27,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Nothing +## [0.3.4] - 2018-08-09 -## [0.3.3] - 2018-08-09 - -### Fixed -- Fixed #10: Missing `plan_id` when create new subscription. Thank @Georde ([7af238e](https://github.com/oanhnn/laravel-pricing-plans/commit/7af238ebc0368e2170643385ece0e1aa9903bcb4)) - - - -## [0.3.2] - 2018-08-07 - -### Fixed -- Fixed #3 : Incorrect `belongTo` parameters in `BelongsToPlanModel` Trait. ([32ee324](https://github.com/oanhnn/laravel-pricing-plans/commit/32ee3243907feffbe80f3ae0a2f226ce3ca1f5df)) -- Fixed #8 : Missing `findByCode` method. ([32ee324](https://github.com/oanhnn/laravel-pricing-plans/commit/32ee3243907feffbe80f3ae0a2f226ce3ca1f5df)) -- Fixed: `SubscriptionAbility::consumed()` method return incorrect value. ([32ee324](https://github.com/oanhnn/laravel-pricing-plans/commit/32ee3243907feffbe80f3ae0a2f226ce3ca1f5df)) - - - -## [0.3.1] - 2018-07-20 - -### Fixed -- Fixed: `Subscribable` trait with `Subscriber` interface. ([304f7b6](https://github.com/oanhnn/laravel-pricing-plans/tree/304f7b60db149b52e76f847a7913349f113bb602)) -- Fixed: TravisCI send coverage. ([b329094](https://github.com/oanhnn/laravel-pricing-plans/commit/b32909481d2116fc51793567f78acaec20cf9f98)) - - - -## [0.3.0] - 2018-05-27 - -### Added -- Add local scope `code` for `Plan` and `Feature` model - -### Fixed -- Fixed: Missing `value` and `node` attributes of `$plan->features->pivot` - - - -## [0.2.3] - 2018-03-27 - -### Fixed -- Fixed: incorrect relationship in Feature and Plan models. ([51ff5f3](https://github.com/oanhnn/laravel-pricing-plans/commit/51ff5f3644a318b999cc47491baa5d7c9d36d7ad)) - Thank @cimon77 - - - -## [0.2.2] - 2018-03-27 - -### Changed -- Update TravisCI, remove allow failure on Laravel 5.6.* ([d7f934f](https://github.com/oanhnn/laravel-pricing-plans/commit/d7f934f49637460d9978fac1d803b6fae095e6d4)) - -### Fixed -- Fixed: Incorrect relationship in Feature model. ([7b26b76](https://github.com/oanhnn/laravel-pricing-plans/commit/7b26b7619a34af2e9a81921d50e343f552f081c4)) - Thank @cimon77 - - - -## [0.2.1] - 2018-02-26 -### Added -- Add link to origin repository in README ([afe05ce](https://github.com/oanhnn/laravel-pricing-plans/commit/afe05cee6fd1c0b1e9f5fbfe672f48dd2cbb4967)) - -### Changed -- Changed CHANGELOG format ([afe05ce](https://github.com/oanhnn/laravel-pricing-plans/commit/afe05cee6fd1c0b1e9f5fbfe672f48dd2cbb4967)) -- Update LICENSE ([afe05ce](https://github.com/oanhnn/laravel-pricing-plans/commit/afe05cee6fd1c0b1e9f5fbfe672f48dd2cbb4967)) - -### Fixed -- Fixed: TravisCI build ([358dcee](https://github.com/oanhnn/laravel-pricing-plans/commit/358dcee6afbc99b75da967fcd25f4656d3dfa16b)) - - - -## [0.2.0] - 2018-02-22 -### Added -- Laravel 5.6 Compatibility ([e754ae0](https://github.com/oanhnn/laravel-pricing-plans/commit/e754ae01a6c086d1c5b75074b1376a057d616b35)) -- Added matrix test with TravisCI ([e754ae0](https://github.com/oanhnn/laravel-pricing-plans/commit/e754ae01a6c086d1c5b75074b1376a057d616b35)) - -### Changed -- Added `code` column to `plans` and `features` tables ([dce3518](https://github.com/oanhnn/laravel-pricing-plans/commit/dce351893d386d8cd8207608c8f92820767c8ac8)) - - - -## 0.1.0 - 2018-01-09 -### Added -- Initial repository and package -- Added migration file -- Added config file -- Added some tests - - - -[Unreleased]: https://github.com/oanhnn/laravel-pricing-plans/compare/v0.3.3...develop -[0.3.3]: https://github.com/oanhnn/laravel-pricing-plans/compare/v0.3.2...v0.3.3 -[0.3.2]: https://github.com/oanhnn/laravel-pricing-plans/compare/v0.3.1...v0.3.2 -[0.3.1]: https://github.com/oanhnn/laravel-pricing-plans/compare/v0.3.0...v0.3.1 -[0.3.0]: https://github.com/oanhnn/laravel-pricing-plans/compare/v0.2.3...v0.3.0 -[0.2.3]: https://github.com/oanhnn/laravel-pricing-plans/compare/v0.2.2...v0.2.3 -[0.2.2]: https://github.com/oanhnn/laravel-pricing-plans/compare/v0.2.1...v0.2.2 -[0.2.1]: https://github.com/oanhnn/laravel-pricing-plans/compare/v0.2.0...v0.2.1 -[0.2.0]: https://github.com/oanhnn/laravel-pricing-plans/compare/v0.1.0...v0.2.0 +### Support for Laravel 7 and Symphony 5 +- Added support for laravel 7.* and Symphony 5 From 21f726f8237811c87d842f051f7da19a77046817 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 25 Aug 2020 18:04:58 +0100 Subject: [PATCH 06/22] update to laravel 7 --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6923f7e..d1231c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,7 +27,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Nothing -## [0.3.4] - 2018-08-09 +## [0.3.4] - 2020-08-25 ### Support for Laravel 7 and Symphony 5 - Added support for laravel 7.* and Symphony 5 From f8631c7423f18b6a3e14635ed4f4d47fbebe1b2b Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 19 Jan 2021 18:36:38 +0100 Subject: [PATCH 07/22] update to support laravel 8 --- .phpunit.result.cache | 1 + README.md | 7 ++++--- composer.json | 18 +++++++++--------- 3 files changed, 14 insertions(+), 12 deletions(-) create mode 100644 .phpunit.result.cache diff --git a/.phpunit.result.cache b/.phpunit.result.cache new file mode 100644 index 0000000..481896c --- /dev/null +++ b/.phpunit.result.cache @@ -0,0 +1 @@ +C:37:"PHPUnit\Runner\DefaultTestResultCache":1959:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:19:{s:82:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCreateAFeature";d:0.095;s:86:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCalculateResetTime";d:0.014;s:93:"Laravel\PricingPlans\Tests\Integration\Models\PlanTest::testItCanCreateAPlanAndAttachFeatures";d:0.017;s:84:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanGetAllIntervalsWithTranslations";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #0";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #1";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #2";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #3";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #4";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #5";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #6";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #7";d:0.013;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #8";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #9";d:0.01;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #10";d:0.012;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #11";d:0.012;s:83:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriodWithEmptyStart";d:0.011;s:81:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItThrowExceptionOnInvalidInterval";d:0.011;s:73:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanValidateIntervalUnit";d:0.01;}}} \ No newline at end of file diff --git a/README.md b/README.md index 0139ac6..127a485 100644 --- a/README.md +++ b/README.md @@ -5,18 +5,19 @@ [![Latest Version](https://img.shields.io/github/release/oanhnn/laravel-pricing-plans.svg?style=flat-square)](https://github.com/oanhnn/laravel-pricing-plans/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -Easy provide pricing plans for Your Laravel 7 Application. Update of oanhnn/laravel-pricing-plans +Easy provide pricing plans for Your Laravel 7|8 Application. Update of oanhnn/laravel-pricing-plans ## Main features Easy provide pricing plans for Your Laravel 7+ Application. +For Laravel 7.0+ use v0.4, for Laravel 8.0+ use v0.5 ## Requirements * php >=7.2 -* Laravel 7.0+ +* Laravel 7.0+ || 8.0+ ## Installation @@ -41,7 +42,7 @@ $ composer phpunit ## Credits -I forked and updated this project to support laravel 7 from [oanhnn/laravel-pricing-plans](https://github.com/oanhnn/laravel-pricing-plans) project in mid-2020. +I forked and updated this project to support laravel 8 from [oanhnn/laravel-pricing-plans](https://github.com/oanhnn/laravel-pricing-plans) project in Jan-2021. ## License diff --git a/composer.json b/composer.json index 904ed01..57d23e2 100644 --- a/composer.json +++ b/composer.json @@ -26,17 +26,17 @@ } }, "require": { - "php": "^7.2.5", - "illuminate/database": "^7.25", - "illuminate/support": "^7.0", - "nesbot/carbon": "^2.39" + "php": "^7.3", + "illuminate/database": "^8.0", + "illuminate/support": "^8.0", + "nesbot/carbon": "^2.43" }, "require-dev": { - "fzaninotto/faker": "~1.9.1", - "mockery/mockery": "^1.3.1", - "orchestra/database": "5.x-dev", - "orchestra/testbench": "^5.4", - "phpunit/phpunit": "~8.5", + "fzaninotto/faker": "~1.9.2", + "mockery/mockery": "^1.4.2", + "orchestra/database": "6.x-dev", + "orchestra/testbench": "^6.9", + "phpunit/phpunit": "~9.0", "squizlabs/php_codesniffer": "^3.5" }, "scripts": { From f724aaa6ef53f4243923f738aa81cf7723a09ad7 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 19 Jan 2021 18:37:06 +0100 Subject: [PATCH 08/22] update to support laravel 8 --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3048ba1..836ac0f 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,4 @@ Icon? ehthumbs.db Thumbs.db *.mo +*.phpunit.result.cache From c14621e298d5caa9e568e3c1222871328856f0e2 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 19 Jan 2021 18:40:27 +0100 Subject: [PATCH 09/22] update to support laravel 8 --- CHANGELOG.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1231c8..9e06db5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -29,5 +29,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ## [0.3.4] - 2020-08-25 +## [0.4.0] - 2021-01-19 ### Support for Laravel 7 and Symphony 5 - Added support for laravel 7.* and Symphony 5 + +## [0.5.0] - 2021-01-19 +### Support for Laravel 8 +- Added support for laravel 8.* + + From a19ee126f5e9178658dcc7cf708b962bd2d827de Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 11 May 2021 15:54:55 +0100 Subject: [PATCH 10/22] added support for php 8 --- .phpunit.result.cache | 2 +- composer.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 481896c..48bacd6 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -C:37:"PHPUnit\Runner\DefaultTestResultCache":1959:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:19:{s:82:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCreateAFeature";d:0.095;s:86:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCalculateResetTime";d:0.014;s:93:"Laravel\PricingPlans\Tests\Integration\Models\PlanTest::testItCanCreateAPlanAndAttachFeatures";d:0.017;s:84:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanGetAllIntervalsWithTranslations";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #0";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #1";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #2";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #3";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #4";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #5";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #6";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #7";d:0.013;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #8";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #9";d:0.01;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #10";d:0.012;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #11";d:0.012;s:83:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriodWithEmptyStart";d:0.011;s:81:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItThrowExceptionOnInvalidInterval";d:0.011;s:73:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanValidateIntervalUnit";d:0.01;}}} \ No newline at end of file +C:37:"PHPUnit\Runner\DefaultTestResultCache":1955:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:19:{s:82:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCreateAFeature";d:0.203;s:86:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCalculateResetTime";d:0.017;s:93:"Laravel\PricingPlans\Tests\Integration\Models\PlanTest::testItCanCreateAPlanAndAttachFeatures";d:0.027;s:84:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanGetAllIntervalsWithTranslations";d:0.013;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #0";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #1";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #2";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #3";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #4";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #5";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #6";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #7";d:0.014;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #8";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #9";d:0.01;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #10";d:0.01;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #11";d:0.01;s:83:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriodWithEmptyStart";d:0.01;s:81:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItThrowExceptionOnInvalidInterval";d:0.012;s:73:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanValidateIntervalUnit";d:0.01;}}} \ No newline at end of file diff --git a/composer.json b/composer.json index 57d23e2..fa4ee1d 100644 --- a/composer.json +++ b/composer.json @@ -26,13 +26,13 @@ } }, "require": { - "php": "^7.3", + "php": "^7.3 || ^8.0", "illuminate/database": "^8.0", "illuminate/support": "^8.0", "nesbot/carbon": "^2.43" }, "require-dev": { - "fzaninotto/faker": "~1.9.2", + "fakerphp/faker": "^1.14.1", "mockery/mockery": "^1.4.2", "orchestra/database": "6.x-dev", "orchestra/testbench": "^6.9", From 312af7ed66b9ec6ea22f3dcf8f9cbf9715bbc569 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 11 May 2021 15:58:11 +0100 Subject: [PATCH 11/22] added support for php 8 --- CHANGELOG.md | 4 ++++ README.md | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e06db5..fb6d2b6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -37,4 +37,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Support for Laravel 8 - Added support for laravel 8.* +## [0.5.1] - 2021-05-11 +### Support for PHP 8 +- Added support for php 8.* + diff --git a/README.md b/README.md index 127a485..03be30e 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ For Laravel 7.0+ use v0.4, for Laravel 8.0+ use v0.5 ## Requirements -* php >=7.2 +* php >=7.2 || 8.0+ * Laravel 7.0+ || 8.0+ ## Installation From 53dae9bd88c9e7fe994b268621795aba0f8c3bfc Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 11 May 2021 16:18:07 +0100 Subject: [PATCH 12/22] added support for php 8 --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index fa4ee1d..e5c367d 100644 --- a/composer.json +++ b/composer.json @@ -26,7 +26,7 @@ } }, "require": { - "php": "^7.3 || ^8.0", + "php": "^7.3|^8.0", "illuminate/database": "^8.0", "illuminate/support": "^8.0", "nesbot/carbon": "^2.43" From 7e1aa814306a13be618cf8cf39ef35c16b3d1e84 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Wed, 15 Feb 2023 11:14:26 +0100 Subject: [PATCH 13/22] Update to support laravel 9 --- .phpunit.result.cache | 2 +- CHANGELOG.md | 4 ++++ README.md | 8 ++++---- composer.json | 24 ++++++++++++++---------- phpunit.xml.dist | 16 +++++++++------- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/.phpunit.result.cache b/.phpunit.result.cache index 48bacd6..b614476 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -C:37:"PHPUnit\Runner\DefaultTestResultCache":1955:{a:2:{s:7:"defects";a:0:{}s:5:"times";a:19:{s:82:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCreateAFeature";d:0.203;s:86:"Laravel\PricingPlans\Tests\Integration\Models\FeatureTest::testItCanCalculateResetTime";d:0.017;s:93:"Laravel\PricingPlans\Tests\Integration\Models\PlanTest::testItCanCreateAPlanAndAttachFeatures";d:0.027;s:84:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanGetAllIntervalsWithTranslations";d:0.013;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #0";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #1";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #2";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #3";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #4";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #5";d:0.011;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #6";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #7";d:0.014;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #8";d:0.01;s:86:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #9";d:0.01;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #10";d:0.01;s:87:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriod with data set #11";d:0.01;s:83:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanCalculateAPeriodWithEmptyStart";d:0.01;s:81:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItThrowExceptionOnInvalidInterval";d:0.012;s:73:"Laravel\PricingPlans\Tests\Unit\PeriodTest::testItCanValidateIntervalUnit";d:0.01;}}} \ No newline at end of file +{"version":1,"defects":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":4,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":4,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #0":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #1":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #2":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #3":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #4":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #5":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #6":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #7":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #8":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #9":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #10":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #11":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":4},"times":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":0.115,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":0.018,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":0.025,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":0.018,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #0":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #1":0.019,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #2":0.016,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #3":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #4":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #5":0.018,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #6":0.016,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #7":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #8":0.022,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #9":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #10":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #11":0.016,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":0.017}} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index fb6d2b6..7fda2f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,4 +41,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Support for PHP 8 - Added support for php 8.* +## [0.5.2] - 2023-02-15 +### Support for PHP 8.1 and Laravel 9.* +- Added support for php 8.1 and Laravel 9 + diff --git a/README.md b/README.md index 03be30e..0d91842 100644 --- a/README.md +++ b/README.md @@ -16,8 +16,8 @@ For Laravel 7.0+ use v0.4, for Laravel 8.0+ use v0.5 ## Requirements -* php >=7.2 || 8.0+ -* Laravel 7.0+ || 8.0+ +* php >=7.2 || 8.0+ || 8.1+ +* Laravel 7.0+ || 8.0+ || 9.0+ ## Installation @@ -33,7 +33,7 @@ $ composer require andychukse/laravel-pricing-plans ## Testing ```bash -$ git clone git@github.com/oanhnn/laravel-pricing-plans.git /path +$ git clone git@github.com/andychukse/laravel-pricing-plans.git /path $ cd /path $ composer install $ composer phpunit @@ -42,7 +42,7 @@ $ composer phpunit ## Credits -I forked and updated this project to support laravel 8 from [oanhnn/laravel-pricing-plans](https://github.com/oanhnn/laravel-pricing-plans) project in Jan-2021. +I forked and updated this project to support laravel 8/9 from [oanhnn/laravel-pricing-plans](https://github.com/oanhnn/laravel-pricing-plans) project. ## License diff --git a/composer.json b/composer.json index e5c367d..5f036a0 100644 --- a/composer.json +++ b/composer.json @@ -26,18 +26,19 @@ } }, "require": { - "php": "^7.3|^8.0", - "illuminate/database": "^8.0", - "illuminate/support": "^8.0", - "nesbot/carbon": "^2.43" + "php": "^7.3||^8.0||^8.1", + "illuminate/database": "^8.0||^9.0", + "illuminate/support": "^8.0||^9.0", + "nesbot/carbon": "^2.62.1" }, "require-dev": { - "fakerphp/faker": "^1.14.1", - "mockery/mockery": "^1.4.2", - "orchestra/database": "6.x-dev", - "orchestra/testbench": "^6.9", - "phpunit/phpunit": "~9.0", - "squizlabs/php_codesniffer": "^3.5" + "fakerphp/faker": "^1.21", + "mockery/mockery": "^1.5.1", + "orchestra/database": "7.0.x-dev", + "orchestra/testbench": "^7.0", + "phpunit/phpunit": "^9.5.8", + "squizlabs/php_codesniffer": "3.*", + "laravie/query-filter": "dev-master" }, "scripts": { "phpunit": "php vendor/phpunit/phpunit/phpunit --coverage-html build/coverage", @@ -50,6 +51,9 @@ "optimize-autoloader": true }, "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + }, "laravel": { "providers": [ "Laravel\\PricingPlans\\PricingPlansServiceProvider" diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 307be0b..b267575 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -9,7 +9,6 @@ processIsolation="false" stopOnError="false" stopOnFailure="false" - syntaxCheck="true" verbose="true" > @@ -25,12 +24,15 @@ - - + + vendor - - + + src - - + + From 3724876b9b0660dddbfdac6bc0bc2b5f4212543b Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Wed, 15 Feb 2023 11:17:38 +0100 Subject: [PATCH 14/22] Update to support laravel 9 --- composer.json | 3 --- 1 file changed, 3 deletions(-) diff --git a/composer.json b/composer.json index 5f036a0..32a0859 100644 --- a/composer.json +++ b/composer.json @@ -51,9 +51,6 @@ "optimize-autoloader": true }, "extra": { - "branch-alias": { - "dev-master": "3.x-dev" - }, "laravel": { "providers": [ "Laravel\\PricingPlans\\PricingPlansServiceProvider" From 21f9e4f55ed0874ed7bf36f8943df3d052f8779a Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Wed, 15 Feb 2023 11:21:26 +0100 Subject: [PATCH 15/22] Update to support laravel 9 --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 0d91842..1c06834 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ [![Latest Version](https://img.shields.io/github/release/oanhnn/laravel-pricing-plans.svg?style=flat-square)](https://github.com/oanhnn/laravel-pricing-plans/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -Easy provide pricing plans for Your Laravel 7|8 Application. Update of oanhnn/laravel-pricing-plans +Easy provide pricing plans for Your Laravel 7|8|9 Application. Update of oanhnn/laravel-pricing-plans ## Main features @@ -16,7 +16,7 @@ For Laravel 7.0+ use v0.4, for Laravel 8.0+ use v0.5 ## Requirements -* php >=7.2 || 8.0+ || 8.1+ +* php >=7.3 || 8.0+ || 8.1+ * Laravel 7.0+ || 8.0+ || 9.0+ ## Installation From 5e1be01561cc870425bb3ae0411b1ec5dd4bee29 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Wed, 15 Feb 2023 11:44:34 +0100 Subject: [PATCH 16/22] Update to support laravel 9 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c06834..9499938 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ [![Build Status](https://travis-ci.org/oanhnn/laravel-pricing-plans.svg?branch=master)](https://travis-ci.org/oanhnn/laravel-pricing-plans) [![Coverage Status](https://coveralls.io/repos/github/oanhnn/laravel-pricing-plans/badge.svg?branch=master)](https://coveralls.io/github/oanhnn/laravel-pricing-plans?branch=master) -[![Latest Version](https://img.shields.io/github/release/oanhnn/laravel-pricing-plans.svg?style=flat-square)](https://github.com/oanhnn/laravel-pricing-plans/releases) +[![Latest Version](https://img.shields.io/github/v/release/andychukse/laravel-pricing-plans)](https://github.com/andychukse/laravel-pricing-plans/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) Easy provide pricing plans for Your Laravel 7|8|9 Application. Update of oanhnn/laravel-pricing-plans From 95816c808938ba55aa95422aeb94d66bbf9706dd Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Tue, 2 Jan 2024 17:10:14 +0100 Subject: [PATCH 17/22] update to support laravel 10 --- .phpunit.cache/test-results | 1 + .phpunit.result.cache | 2 +- README.md | 8 +++--- composer.json | 18 ++++++------ phpunit.xml.dist | 56 +++++++++++++------------------------ phpunit.xml.dist.bak | 38 +++++++++++++++++++++++++ tests/Unit/PeriodTest.php | 2 +- 7 files changed, 74 insertions(+), 51 deletions(-) create mode 100644 .phpunit.cache/test-results create mode 100644 phpunit.xml.dist.bak diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results new file mode 100644 index 0000000..ddf9ea0 --- /dev/null +++ b/.phpunit.cache/test-results @@ -0,0 +1 @@ +{"version":1,"defects":[],"times":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":0.045,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":0.012,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":0.022,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#0":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#1":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#2":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#3":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#4":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#5":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#6":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#7":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#8":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#9":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#10":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#11":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":0.008,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":0.006}} \ No newline at end of file diff --git a/.phpunit.result.cache b/.phpunit.result.cache index b614476..e9facca 100644 --- a/.phpunit.result.cache +++ b/.phpunit.result.cache @@ -1 +1 @@ -{"version":1,"defects":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":4,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":4,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #0":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #1":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #2":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #3":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #4":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #5":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #6":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #7":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #8":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #9":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #10":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #11":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":4},"times":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":0.115,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":0.018,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":0.025,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":0.018,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #0":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #1":0.019,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #2":0.016,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #3":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #4":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #5":0.018,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #6":0.016,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #7":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #8":0.022,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #9":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #10":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #11":0.016,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":0.017}} \ No newline at end of file +{"version":1,"defects":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":4,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":4,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #0":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #1":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #2":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #3":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #4":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #5":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #6":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #7":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #8":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #9":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #10":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #11":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":4,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":4},"times":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":0.047,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":0.013,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":0.022,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #0":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #1":0.019,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #2":0.016,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #3":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #4":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #5":0.018,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #6":0.016,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #7":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #8":0.022,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #9":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #10":0.017,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod with data set #11":0.016,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":0.008,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#0":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#1":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#2":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#3":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#4":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#5":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#6":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#7":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#8":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#9":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#10":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#11":0.005}} \ No newline at end of file diff --git a/README.md b/README.md index 9499938..2d36114 100644 --- a/README.md +++ b/README.md @@ -5,19 +5,19 @@ [![Latest Version](https://img.shields.io/github/v/release/andychukse/laravel-pricing-plans)](https://github.com/andychukse/laravel-pricing-plans/releases) [![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE) -Easy provide pricing plans for Your Laravel 7|8|9 Application. Update of oanhnn/laravel-pricing-plans +Easy provide pricing plans for Your Laravel 7|8|9|10 Application. Update of oanhnn/laravel-pricing-plans ## Main features Easy provide pricing plans for Your Laravel 7+ Application. -For Laravel 7.0+ use v0.4, for Laravel 8.0+ use v0.5 +For Laravel 7.0+ use v0.4, for Laravel 8.0|9.0+ use v0.5, for Laravel 10.0+ use v0.6 ## Requirements -* php >=7.3 || 8.0+ || 8.1+ -* Laravel 7.0+ || 8.0+ || 9.0+ +* php >=7.3 || 8.0+ +* Laravel 7.0+ || 8.0+ || 9.0+ || 10.0+ ## Installation diff --git a/composer.json b/composer.json index 32a0859..88bc043 100644 --- a/composer.json +++ b/composer.json @@ -26,17 +26,17 @@ } }, "require": { - "php": "^7.3||^8.0||^8.1", - "illuminate/database": "^8.0||^9.0", - "illuminate/support": "^8.0||^9.0", - "nesbot/carbon": "^2.62.1" + "php": "^7.3 || ^8.0", + "illuminate/database": "^8.0 || ^9.0 || ^10.0", + "illuminate/support": "^8.0 || ^9.0 || ^10.0", + "nesbot/carbon": "^2.72.1" }, "require-dev": { - "fakerphp/faker": "^1.21", - "mockery/mockery": "^1.5.1", - "orchestra/database": "7.0.x-dev", - "orchestra/testbench": "^7.0", - "phpunit/phpunit": "^9.5.8", + "fakerphp/faker": "^1.23", + "mockery/mockery": "^1.6.7", + "andychukse/database": "7.0.x-dev", + "orchestra/testbench": "^8.0", + "phpunit/phpunit": "^10.0", "squizlabs/php_codesniffer": "3.*", "laravie/query-filter": "dev-master" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index b267575..1be7049 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,38 +1,22 @@ - - - - - - - - - - tests - - - - - - - vendor - - - src - - + + + + + + + + + tests + + + + + + src + + + vendor + + diff --git a/phpunit.xml.dist.bak b/phpunit.xml.dist.bak new file mode 100644 index 0000000..b267575 --- /dev/null +++ b/phpunit.xml.dist.bak @@ -0,0 +1,38 @@ + + + + + + + + + + + tests + + + + + + + vendor + + + src + + + diff --git a/tests/Unit/PeriodTest.php b/tests/Unit/PeriodTest.php index 5f4faac..7c0c3f2 100644 --- a/tests/Unit/PeriodTest.php +++ b/tests/Unit/PeriodTest.php @@ -49,7 +49,7 @@ public function testItCanCalculateAPeriod($unit, $count, $start, $expectedStartA /** * @return array */ - public function periodDataProvider() + public static function periodDataProvider() { $st1 = new DateTime('2018-01-04 10:00:09'); $st2 = new DateTime('2018-01-04 10:10:09'); From 77726705d31cae045e7decc3076f82f32502f39c Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Fri, 16 Feb 2024 19:57:53 +0100 Subject: [PATCH 18/22] update to support laravel 10 --- src/Models/Feature.php | 9 +++++---- src/Models/Plan.php | 9 +++++---- src/Models/PlanFeature.php | 9 +++++---- src/Models/PlanSubscription.php | 16 ++++++++-------- src/Models/PlanSubscriptionUsage.php | 10 +++++----- 5 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/Models/Feature.php b/src/Models/Feature.php index 9049b9e..272feb1 100644 --- a/src/Models/Feature.php +++ b/src/Models/Feature.php @@ -41,15 +41,16 @@ class Feature extends Model ]; /** - * The attributes that should be mutated to dates. + * The attributes that should be mutated to dates * * @var array */ - protected $dates = [ - 'created_at', - 'updated_at', + public $casts = [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', ]; + /** * Plan constructor. * diff --git a/src/Models/Plan.php b/src/Models/Plan.php index 33c42ae..7eaaa8e 100644 --- a/src/Models/Plan.php +++ b/src/Models/Plan.php @@ -44,15 +44,16 @@ class Plan extends Model ]; /** - * The attributes that should be mutated to dates. + * The attributes that should be mutated to dates * * @var array */ - protected $dates = [ - 'created_at', - 'updated_at', + public $casts = [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', ]; + /** * Boot function for using with User Events. * diff --git a/src/Models/PlanFeature.php b/src/Models/PlanFeature.php index e5b6652..acf98d5 100644 --- a/src/Models/PlanFeature.php +++ b/src/Models/PlanFeature.php @@ -31,15 +31,16 @@ class PlanFeature extends Pivot ]; /** - * The attributes that should be mutated to dates. + * The attributes that should be mutated to dates * * @var array */ - protected $dates = [ - 'created_at', - 'updated_at', + public $casts = [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', ]; + /** * @return \Illuminate\Database\Eloquent\Relations\BelongsTo */ diff --git a/src/Models/PlanSubscription.php b/src/Models/PlanSubscription.php index 3a31a69..3e248a2 100644 --- a/src/Models/PlanSubscription.php +++ b/src/Models/PlanSubscription.php @@ -59,17 +59,17 @@ class PlanSubscription extends Model ]; /** - * The attributes that should be mutated to dates. + * The attributes that should be mutated to dates * * @var array */ - protected $dates = [ - 'created_at', - 'updated_at', - 'starts_at', - 'ends_at', - 'canceled_at', - 'trial_ends_at', + public $casts = [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'starts_at' => 'datetime', + 'ends_at' => 'datetime', + 'canceled_at' => 'datetime', + 'trial_ends_at' => 'datetime', ]; /** diff --git a/src/Models/PlanSubscriptionUsage.php b/src/Models/PlanSubscriptionUsage.php index 9687e3e..f0330f9 100644 --- a/src/Models/PlanSubscriptionUsage.php +++ b/src/Models/PlanSubscriptionUsage.php @@ -31,14 +31,14 @@ class PlanSubscriptionUsage extends Model ]; /** - * The attributes that should be mutated to dates. + * The attributes that should be mutated to dates * * @var array */ - protected $dates = [ - 'created_at', - 'updated_at', - 'valid_until', + public $casts = [ + 'created_at' => 'datetime', + 'updated_at' => 'datetime', + 'valid_until' => 'datetime', ]; /** From fd3eed67038b310d637b893c10c13e50a9b85ff7 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Fri, 16 Feb 2024 20:13:44 +0100 Subject: [PATCH 19/22] update to support laravel 10 --- src/Models/Feature.php | 2 +- src/Models/Plan.php | 2 +- src/Models/PlanFeature.php | 2 +- src/Models/PlanSubscription.php | 2 +- src/Models/PlanSubscriptionUsage.php | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/Models/Feature.php b/src/Models/Feature.php index 272feb1..8690ac8 100644 --- a/src/Models/Feature.php +++ b/src/Models/Feature.php @@ -45,7 +45,7 @@ class Feature extends Model * * @var array */ - public $casts = [ + protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; diff --git a/src/Models/Plan.php b/src/Models/Plan.php index 7eaaa8e..1831fa8 100644 --- a/src/Models/Plan.php +++ b/src/Models/Plan.php @@ -48,7 +48,7 @@ class Plan extends Model * * @var array */ - public $casts = [ + protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; diff --git a/src/Models/PlanFeature.php b/src/Models/PlanFeature.php index acf98d5..4e08ff0 100644 --- a/src/Models/PlanFeature.php +++ b/src/Models/PlanFeature.php @@ -35,7 +35,7 @@ class PlanFeature extends Pivot * * @var array */ - public $casts = [ + protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', ]; diff --git a/src/Models/PlanSubscription.php b/src/Models/PlanSubscription.php index 3e248a2..4129dab 100644 --- a/src/Models/PlanSubscription.php +++ b/src/Models/PlanSubscription.php @@ -63,7 +63,7 @@ class PlanSubscription extends Model * * @var array */ - public $casts = [ + protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', 'starts_at' => 'datetime', diff --git a/src/Models/PlanSubscriptionUsage.php b/src/Models/PlanSubscriptionUsage.php index f0330f9..de384a3 100644 --- a/src/Models/PlanSubscriptionUsage.php +++ b/src/Models/PlanSubscriptionUsage.php @@ -35,7 +35,7 @@ class PlanSubscriptionUsage extends Model * * @var array */ - public $casts = [ + protected $casts = [ 'created_at' => 'datetime', 'updated_at' => 'datetime', 'valid_until' => 'datetime', From 886efefb686f481b5405847f1f74449a75bc0d31 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Fri, 16 Feb 2024 20:33:49 +0100 Subject: [PATCH 20/22] update to support laravel 10 --- src/Models/Concerns/Subscribable.php | 2 +- src/Models/PlanFeature.php | 1 + src/Models/PlanSubscription.php | 2 ++ 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Models/Concerns/Subscribable.php b/src/Models/Concerns/Subscribable.php index e3c5d3b..d119475 100644 --- a/src/Models/Concerns/Subscribable.php +++ b/src/Models/Concerns/Subscribable.php @@ -63,7 +63,7 @@ public function subscribed(string $subscription, string $planCode = null): bool } if (is_null($planCode) || $planCode == $planSubscription->plan->code) { - return $subscription->isActive(); + return $planSubscription->isActive(); } return false; diff --git a/src/Models/PlanFeature.php b/src/Models/PlanFeature.php index 4e08ff0..88a7bd5 100644 --- a/src/Models/PlanFeature.php +++ b/src/Models/PlanFeature.php @@ -4,6 +4,7 @@ use Illuminate\Database\Eloquent\Relations\Pivot; use Laravel\PricingPlans\Models\Concerns\BelongsToPlanModel; +use Illuminate\Support\Facades\Config; /** * Class PlanFeature diff --git a/src/Models/PlanSubscription.php b/src/Models/PlanSubscription.php index 4129dab..319949a 100644 --- a/src/Models/PlanSubscription.php +++ b/src/Models/PlanSubscription.php @@ -10,6 +10,8 @@ use Illuminate\Support\Facades\Event; use InvalidArgumentException; use Laravel\PricingPlans\Events\SubscriptionRenewed; +use Laravel\PricingPlans\Events\SubscriptionCanceled; +use Laravel\PricingPlans\Events\SubscriptionPlanChanged; use Laravel\PricingPlans\Period; use Laravel\PricingPlans\SubscriptionAbility; use Laravel\PricingPlans\SubscriptionUsageManager; From 79ce0975c1aab9df849a2a0667bf7bb04cda7317 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Sat, 17 Feb 2024 14:42:11 +0100 Subject: [PATCH 21/22] update readme and changelog --- .phpunit.cache/test-results | 2 +- CHANGELOG.md | 8 ++++++++ README.md | 2 +- composer.json | 6 +++--- 4 files changed, 13 insertions(+), 5 deletions(-) diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results index ddf9ea0..43c924d 100644 --- a/.phpunit.cache/test-results +++ b/.phpunit.cache/test-results @@ -1 +1 @@ -{"version":1,"defects":[],"times":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":0.045,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":0.012,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":0.022,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#0":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#1":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#2":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#3":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#4":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#5":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#6":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#7":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#8":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#9":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#10":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#11":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":0.008,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":0.006}} \ No newline at end of file +{"version":1,"defects":[],"times":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":0.022,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":0.007,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":0.014,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":0.008,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#0":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#1":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#2":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#3":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#4":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#5":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#6":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#7":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#8":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#9":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#10":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#11":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":0.005}} \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fda2f9..35a5d1d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -45,4 +45,12 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. ### Support for PHP 8.1 and Laravel 9.* - Added support for php 8.1 and Laravel 9 +## [0.6.1] - 2024-02-16 +### Support for PHP 8.2 and Laravel 10.* +- Added support for php 8.2 and Laravel 10 + +## [0.6.3] - 2023-02-15 +### Fixed date casting issues for laravel 10 +- Fixed date casting issues for laravel 10 + diff --git a/README.md b/README.md index 2d36114..b1db423 100644 --- a/README.md +++ b/README.md @@ -42,7 +42,7 @@ $ composer phpunit ## Credits -I forked and updated this project to support laravel 8/9 from [oanhnn/laravel-pricing-plans](https://github.com/oanhnn/laravel-pricing-plans) project. +I forked and updated this project to support laravel 8/9/10 from [oanhnn/laravel-pricing-plans](https://github.com/oanhnn/laravel-pricing-plans) project. ## License diff --git a/composer.json b/composer.json index 88bc043..e6e613e 100644 --- a/composer.json +++ b/composer.json @@ -41,9 +41,9 @@ "laravie/query-filter": "dev-master" }, "scripts": { - "phpunit": "php vendor/phpunit/phpunit/phpunit --coverage-html build/coverage", - "phpcs": "php vendor/squizlabs/php_codesniffer/bin/phpcs", - "phpcbf": "php vendor/squizlabs/php_codesniffer/bin/phpcbf" + "phpunit": "php ./vendor/bin/phpunit --coverage-html build/coverage", + "phpcs": "php ./vendor/squizlabs/php_codesniffer/bin/phpcs", + "phpcbf": "php ./vendor/squizlabs/php_codesniffer/bin/phpcbf" }, "config": { "preferred-install": "dist", From f918853ab33970bbac49869c7a2cab6d3df6c465 Mon Sep 17 00:00:00 2001 From: Andy Eze Date: Mon, 4 Nov 2024 14:16:09 +0100 Subject: [PATCH 22/22] added support for laravel 11 --- .phpunit.cache/test-results | 2 +- README.md | 7 ++++--- composer.json | 8 ++++---- phpunit.xml.dist | 14 +++++++++++++- 4 files changed, 22 insertions(+), 9 deletions(-) diff --git a/.phpunit.cache/test-results b/.phpunit.cache/test-results index 43c924d..fcf3c4f 100644 --- a/.phpunit.cache/test-results +++ b/.phpunit.cache/test-results @@ -1 +1 @@ -{"version":1,"defects":[],"times":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":0.022,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":0.007,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":0.014,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":0.008,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#0":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#1":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#2":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#3":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#4":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#5":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#6":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#7":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#8":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#9":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#10":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#11":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":0.005,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":0.005}} \ No newline at end of file +{"version":1,"defects":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":8,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":8,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#0":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#1":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#2":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#3":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#4":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#5":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#6":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#7":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#8":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#9":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#10":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#11":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":8,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":8},"times":{"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCreateAFeature":0.027,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\FeatureTest::testItCanCalculateResetTime":0.008,"Laravel\\PricingPlans\\Tests\\Integration\\Models\\PlanTest::testItCanCreateAPlanAndAttachFeatures":0.013,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanGetAllIntervalsWithTranslations":0.007,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#0":0.007,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#1":0.007,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#2":0.007,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#3":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#4":0.011,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#5":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#6":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#7":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#8":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#9":0.007,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#10":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriod#11":0.009,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanCalculateAPeriodWithEmptyStart":0.006,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItThrowExceptionOnInvalidInterval":0.008,"Laravel\\PricingPlans\\Tests\\Unit\\PeriodTest::testItCanValidateIntervalUnit":0.006}} \ No newline at end of file diff --git a/README.md b/README.md index b1db423..cc2681e 100644 --- a/README.md +++ b/README.md @@ -12,12 +12,13 @@ Easy provide pricing plans for Your Laravel 7|8|9|10 Application. Update of oanh Easy provide pricing plans for Your Laravel 7+ Application. For Laravel 7.0+ use v0.4, for Laravel 8.0|9.0+ use v0.5, for Laravel 10.0+ use v0.6 +for Laravel 11.0+ use v0.7 ## Requirements -* php >=7.3 || 8.0+ -* Laravel 7.0+ || 8.0+ || 9.0+ || 10.0+ +* php >=7.3 || ^8.0+ +* Laravel 7.0+ || 8.0+ || 9.0+ || 10.0+ || 11.0+ ## Installation @@ -42,7 +43,7 @@ $ composer phpunit ## Credits -I forked and updated this project to support laravel 8/9/10 from [oanhnn/laravel-pricing-plans](https://github.com/oanhnn/laravel-pricing-plans) project. +I forked and updated this project to support laravel 8/9/10/11 from [oanhnn/laravel-pricing-plans](https://github.com/oanhnn/laravel-pricing-plans) project. ## License diff --git a/composer.json b/composer.json index e6e613e..b732855 100644 --- a/composer.json +++ b/composer.json @@ -27,16 +27,16 @@ }, "require": { "php": "^7.3 || ^8.0", - "illuminate/database": "^8.0 || ^9.0 || ^10.0", - "illuminate/support": "^8.0 || ^9.0 || ^10.0", + "illuminate/database": "^8.0 || ^9.0 || ^10.0 || ^11.0", + "illuminate/support": "^8.0 || ^9.0 || ^10.0 || ^11.0", "nesbot/carbon": "^2.72.1" }, "require-dev": { "fakerphp/faker": "^1.23", "mockery/mockery": "^1.6.7", "andychukse/database": "7.0.x-dev", - "orchestra/testbench": "^8.0", - "phpunit/phpunit": "^10.0", + "orchestra/testbench": "^9.0", + "phpunit/phpunit": "^11.0", "squizlabs/php_codesniffer": "3.*", "laravie/query-filter": "dev-master" }, diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 1be7049..f0000ea 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,5 +1,17 @@ - +