From cf6c62e162fc76d2f208cb6242087fe1ba9084ec Mon Sep 17 00:00:00 2001 From: Marc Roberts Date: Tue, 1 Feb 2022 09:54:54 +0000 Subject: [PATCH 1/7] Add support for Laravel 9.x --- .github/workflows/php.yml | 4 ++-- composer.json | 10 +++++----- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 0766ec8..50763a9 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -9,8 +9,8 @@ jobs: max-parallel: 15 fail-fast: false matrix: - laravel-version: ['5.8.*', '^6.0', '^7.0', '^8.0'] - php-versions: ['7.3', '7.4'] + laravel-version: ['5.8.*', '^6.0', '^7.0', '^8.0', '^9.0'] + php-versions: ['7.3', '7.4', '8.0', '8.1'] name: PHP ${{ matrix.php-versions }} on Laravel ${{ matrix.laravel-version }} steps: - name: Checkout diff --git a/composer.json b/composer.json index 967861d..4b1f542 100644 --- a/composer.json +++ b/composer.json @@ -22,12 +22,12 @@ } ], "require": { - "php": ">=7.2", + "php": ">=7.2|^8.0", "twilio/sdk": "~6.0", - "illuminate/notifications": "^5.8 || ^6.0 || ^7.0 || ^8.0", - "illuminate/support": "^5.8 || ^6.0 || ^7.0 || ^8.0", - "illuminate/events": "^5.8 || ^6.0 || ^7.0 || ^8.0", - "illuminate/queue": "^5.8 || ^6.0 || ^7.0 || ^8.0" + "illuminate/notifications": "^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/support": "^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/events": "^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0", + "illuminate/queue": "^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0" }, "require-dev": { "mockery/mockery": "^1.3", From ad036e57389e86ed5138f70d647a0faea68cb5aa Mon Sep 17 00:00:00 2001 From: Marc Roberts Date: Tue, 1 Feb 2022 09:57:50 +0000 Subject: [PATCH 2/7] Update supported Laravel versions in README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7be4064..96b61a8 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ [![Code Coverage](https://img.shields.io/scrutinizer/coverage/g/laravel-notification-channels/twilio/master.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/twilio/?branch=master) [![Total Downloads](https://img.shields.io/packagist/dt/laravel-notification-channels/twilio.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/twilio) -This package makes it easy to send [Twilio notifications](https://documentation.twilio.com/docs) with Laravel 5.5+, 6.x and 7.x +This package makes it easy to send [Twilio notifications](https://documentation.twilio.com/docs) with Laravel 5.5+, 6.x, 7.x, 8.x & 9.x You are viewing the `3.x` documentation. [Click here](https://github.com/laravel-notification-channels/twilio/tree/2.x) to view the `2.x` documentation. From 82c53b5b44f33504e23707813a2b7439cc72d724 Mon Sep 17 00:00:00 2001 From: Marc Roberts Date: Tue, 1 Feb 2022 10:42:02 +0000 Subject: [PATCH 3/7] Fix tests --- .github/workflows/php.yml | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 50763a9..c98d788 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -10,15 +10,26 @@ jobs: fail-fast: false matrix: laravel-version: ['5.8.*', '^6.0', '^7.0', '^8.0', '^9.0'] - php-versions: ['7.3', '7.4', '8.0', '8.1'] - name: PHP ${{ matrix.php-versions }} on Laravel ${{ matrix.laravel-version }} + php-version: ['7.3', '7.4', '8.0', '8.1'] + exclude: + - laravel-version: '5.8.*' + php-version: '8.0' + - laravel-version: '5.8.*' + php-version: '8.1' + - laravel-version: '^7.0' + php-version: '8.1' + - laravel-version: '^9.0' + php-version: '7.3' + - laravel-version: '^9.0' + php-version: '7.4' + name: PHP ${{ matrix.php-version }} on Laravel ${{ matrix.laravel-version }} steps: - name: Checkout uses: actions/checkout@master - name: Setup PHP uses: shivammathur/setup-php@master with: - php-version: ${{ matrix.php-versions }} + php-version: ${{ matrix.php-version }} extension-csv: mbstring, xdebug coverage: xdebug - name: Install dependencies @@ -32,5 +43,5 @@ jobs: - name: Run Integration Tests if: matrix.laravel-version == '^7.0' run: | - composer require --dev --no-interaction "orchestra/testbench:^5.1" + composer require --dev --no-interaction "orchestra/testbench:^5.1" "egulias/email-validator:^2.1.10" composer test:integration From f6b5000ad309c1d1097f620b8bd99e12138da851 Mon Sep 17 00:00:00 2001 From: Marc Roberts Date: Wed, 9 Feb 2022 09:57:44 +0000 Subject: [PATCH 4/7] Use string type only in routeNotificationFor call --- src/TwilioChannel.php | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/TwilioChannel.php b/src/TwilioChannel.php index e5cc8f9..70d25a1 100755 --- a/src/TwilioChannel.php +++ b/src/TwilioChannel.php @@ -86,9 +86,6 @@ public function send($notifiable, Notification $notification) */ protected function getTo($notifiable, $notification = null) { - if ($notifiable->routeNotificationFor(self::class, $notification)) { - return $notifiable->routeNotificationFor(self::class, $notification); - } if ($notifiable->routeNotificationFor('twilio', $notification)) { return $notifiable->routeNotificationFor('twilio', $notification); } From 227ce3778a72c7b83f206dd15ed9e28c55562788 Mon Sep 17 00:00:00 2001 From: Marc Roberts Date: Wed, 9 Feb 2022 10:19:12 +0000 Subject: [PATCH 5/7] Revert "Use string type only in routeNotificationFor call" This reverts commit f6b5000ad309c1d1097f620b8bd99e12138da851. --- src/TwilioChannel.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/TwilioChannel.php b/src/TwilioChannel.php index 70d25a1..e5cc8f9 100755 --- a/src/TwilioChannel.php +++ b/src/TwilioChannel.php @@ -86,6 +86,9 @@ public function send($notifiable, Notification $notification) */ protected function getTo($notifiable, $notification = null) { + if ($notifiable->routeNotificationFor(self::class, $notification)) { + return $notifiable->routeNotificationFor(self::class, $notification); + } if ($notifiable->routeNotificationFor('twilio', $notification)) { return $notifiable->routeNotificationFor('twilio', $notification); } From 211cf111ea0b961399c2352790e61d2ed9573386 Mon Sep 17 00:00:00 2001 From: Marc Roberts Date: Wed, 9 Feb 2022 15:24:47 +0000 Subject: [PATCH 6/7] remove L6/PHP8.1 combo --- .github/workflows/php.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index c98d788..837f6c0 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -16,6 +16,8 @@ jobs: php-version: '8.0' - laravel-version: '5.8.*' php-version: '8.1' + - laravel-version: '^6.0' + php-version: '8.1' - laravel-version: '^7.0' php-version: '8.1' - laravel-version: '^9.0' From 31144e261e4e4bb214e0b5f8a146760e2b7dac04 Mon Sep 17 00:00:00 2001 From: Marc Roberts Date: Wed, 9 Feb 2022 15:25:08 +0000 Subject: [PATCH 7/7] run integrations tests on all combinations --- .github/workflows/php.yml | 5 +---- composer.json | 3 ++- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.github/workflows/php.yml b/.github/workflows/php.yml index 837f6c0..39150be 100644 --- a/.github/workflows/php.yml +++ b/.github/workflows/php.yml @@ -43,7 +43,4 @@ jobs: - name: Run Tests run: composer test:unit - name: Run Integration Tests - if: matrix.laravel-version == '^7.0' - run: | - composer require --dev --no-interaction "orchestra/testbench:^5.1" "egulias/email-validator:^2.1.10" - composer test:integration + run: composer test:integration diff --git a/composer.json b/composer.json index 4b1f542..5cc0fae 100644 --- a/composer.json +++ b/composer.json @@ -31,7 +31,8 @@ }, "require-dev": { "mockery/mockery": "^1.3", - "phpunit/phpunit": "^8.5" + "phpunit/phpunit": "^8.5|^9.5", + "orchestra/testbench": "^3|^4|^5|^6|^7" }, "autoload": { "psr-4": {