forked from brayancruces/twilio
-
Notifications
You must be signed in to change notification settings - Fork 39
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from onlime/4.x
Major overhaul for a possible 4.x release, twilio/sdk 8.x
- Loading branch information
Showing
31 changed files
with
516 additions
and
405 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
name: CI | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
phplint: | ||
runs-on: ubuntu-latest | ||
|
||
name: PHP Linting (Pint) | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: "laravel-pint" | ||
uses: aglipanci/laravel-pint-action@latest | ||
with: | ||
preset: laravel | ||
verboseMode: true | ||
testMode: true | ||
configPath: "pint.json" | ||
pintVersion: 1.18.2 | ||
onlyDirty: true | ||
|
||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
max-parallel: 15 | ||
fail-fast: false | ||
matrix: | ||
php: [8.3, 8.2] | ||
laravel: [11.*] | ||
stability: [prefer-lowest, prefer-stable] | ||
include: | ||
- laravel: 11.* | ||
testbench: 9.* | ||
|
||
name: PHP${{ matrix.php }} - L${{ matrix.laravel }} - ${{ matrix.stability }} | ||
|
||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Setup PHP | ||
uses: shivammathur/setup-php@v2 | ||
with: | ||
php-version: ${{ matrix.php }} | ||
extensions: mbstring, xdebug | ||
coverage: xdebug | ||
|
||
- name: Install dependencies | ||
run: | | ||
composer require "illuminate/support:${{ matrix.laravel }}" "orchestra/testbench:${{ matrix.testbench }}" --no-interaction --no-update | ||
composer update --${{ matrix.stability }} --prefer-dist --no-interaction --no-suggest | ||
- name: Lint composer.json | ||
run: composer validate | ||
|
||
- name: Run Tests | ||
run: composer test:unit | ||
|
||
- name: Run Integration Tests | ||
run: composer test:integration |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,3 +27,6 @@ phpunit.phar | |
|
||
# build | ||
build | ||
|
||
# laravel/pint | ||
.pint.cache.json |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,11 @@ | ||
# Twilio notifications channel for Laravel | ||
|
||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-notification-channels/twilio.svg?style=flat-square)](https://packagist.org/packages/laravel-notification-channels/twilio) | ||
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md) | ||
[![Build Status](https://img.shields.io/github/workflow/status/laravel-notification-channels/twilio/PHP?style=flat-square)](https://travis-ci.org/laravel-notification-channels/twilio) | ||
[![StyleCI](https://styleci.io/repos/65543339/shield)](https://styleci.io/repos/65543339) | ||
[![Quality Score](https://img.shields.io/scrutinizer/g/laravel-notification-channels/twilio.svg?style=flat-square)](https://scrutinizer-ci.com/g/laravel-notification-channels/twilio) | ||
[![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) | ||
[![Latest Version on Packagist](https://img.shields.io/packagist/v/laravel-notification-channels/twilio.svg)](https://packagist.org/packages/laravel-notification-channels/twilio) | ||
[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg)](LICENSE.md) | ||
[![Build Status](https://github.com/laravel-notification-channels/twilio/actions/workflows/ci.yml/badge.svg)](https://github.com/laravel-notification-channels/twilio/actions/workflows/ci.yml) | ||
[![Total Downloads](https://img.shields.io/packagist/dt/laravel-notification-channels/twilio.svg)](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, 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. | ||
This package makes it easy to send [Twilio notifications](https://documentation.twilio.com/docs) with Laravel 11.x | ||
|
||
## Contents | ||
|
||
|
@@ -26,10 +21,10 @@ You are viewing the `3.x` documentation. [Click here](https://github.com/laravel | |
|
||
## Installation | ||
|
||
You can install the package via composer: | ||
You can install the package via Composer: | ||
|
||
``` bash | ||
composer require laravel-notification-channels/twilio | ||
$ composer require laravel-notification-channels/twilio | ||
``` | ||
|
||
### Configuration | ||
|
@@ -58,7 +53,7 @@ Run `php artisan vendor:publish --provider="NotificationChannels\Twilio\TwilioPr | |
#### Suppressing specific errors or all errors | ||
|
||
Publish the config using the above command, and edit the `ignored_error_codes` array. You can get the list of | ||
exception codes from [the documentation](https://www.twilio.com/docs/api/errors). | ||
exception codes from [the documentation](https://www.twilio.com/docs/api/errors). | ||
|
||
If you want to suppress all errors, you can set the option to `['*']`. The errors will not be logged but notification | ||
failed events will still be emitted. | ||
|
@@ -70,15 +65,19 @@ Twilio recommends always using a [Messaging Service](https://www.twilio.com/docs | |
|
||
Having issues with SMS? Check Twilio's [best practices](https://www.twilio.com/docs/sms/services/services-best-practices). | ||
|
||
## Upgrading from 3.x to 4.x | ||
|
||
We have dropped support for PHP < 8.2 and the minimum Laravel version is now 11. Other than that, there are no breaking changes. | ||
|
||
## Upgrading from 2.x to 3.x | ||
|
||
If you're upgrading from version `2.x`, you'll need to make sure that your set environment variables match those above | ||
in the config section. None of the environment variable names have changed, but if you used different keys in your | ||
If you're upgrading from version `2.x`, you'll need to make sure that your set environment variables match those above | ||
in the config section. None of the environment variable names have changed, but if you used different keys in your | ||
`services.php` config then you'll need to update them to match the above, or publish the config file and change the | ||
`env` key. | ||
|
||
You should also remove the old entry for `twilio` from your `services.php` config, since it's no longer used. | ||
|
||
The main breaking change between `2.x` and `3.x` is that failed notification will now throw an exception unless they are | ||
in the list of ignored error codes (publish the config file to edit these). | ||
|
||
|
@@ -188,14 +187,16 @@ $ composer test | |
|
||
## Security | ||
|
||
If you discover any security related issues, please email [email protected] instead of using the issue tracker. | ||
If you discover any security related issues, please email [email protected] instead of using the issue tracker. | ||
|
||
## Contributing | ||
|
||
Please see [CONTRIBUTING](CONTRIBUTING.md) for details. | ||
|
||
## Credits | ||
|
||
- [Philip Iezzi (Pipo)](https://github.com/onlime) | ||
- [Pascal Baljet](https://github.com/pascalbaljet) | ||
- [Gregorio Hernández Caso](https://github.com/gregoriohc) | ||
- [atymic](https://github.com/atymic) | ||
- [All Contributors](../../contributors) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -15,6 +15,12 @@ | |
"source": "https://github.com/laravel-notification-channels/twilio" | ||
}, | ||
"authors": [ | ||
{ | ||
"name": "Philip Iezzi", | ||
"email": "[email protected]", | ||
"homepage": "https://github.com/onlime", | ||
"role": "Developer" | ||
}, | ||
{ | ||
"name": "Gregorio Hernández Caso", | ||
"email": "[email protected]", | ||
|
@@ -29,17 +35,18 @@ | |
} | ||
], | ||
"require": { | ||
"php": ">=7.2|^8.0", | ||
"twilio/sdk": "~6.0|^7.16", | ||
"illuminate/notifications": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0", | ||
"illuminate/support": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0", | ||
"illuminate/events": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0", | ||
"illuminate/queue": "^7.0 || ^8.0 || ^9.0 || ^10.0|^11.0" | ||
"php": "^8.2", | ||
"twilio/sdk": "^7.16 || ^8.3", | ||
"illuminate/notifications": "^11.0", | ||
"illuminate/support": "^11.0", | ||
"illuminate/events": "^11.0", | ||
"illuminate/queue": "^11.0" | ||
}, | ||
"require-dev": { | ||
"mockery/mockery": "^1.3", | ||
"phpunit/phpunit": "^8.5|^9.5|^10.5", | ||
"orchestra/testbench": "^5.0 || ^6.0 || ^7.0 || ^8.0|^9.0" | ||
"laravel/pint": "^1.18", | ||
"mockery/mockery": "^1.0", | ||
"orchestra/testbench": "^9.0", | ||
"phpunit/phpunit": "^10.5" | ||
}, | ||
"autoload": { | ||
"psr-4": { | ||
|
@@ -53,8 +60,8 @@ | |
}, | ||
"scripts": { | ||
"test": "vendor/bin/phpunit", | ||
"test:unit": "phpunit --verbose --testsuite Unit", | ||
"test:integration": "phpunit --verbose --testsuite Integration" | ||
"test:unit": "phpunit --testsuite Unit", | ||
"test:integration": "phpunit --testsuite Integration" | ||
}, | ||
"config": { | ||
"sort-packages": true | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,33 +1,26 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<phpunit bootstrap="vendor/autoload.php" | ||
backupGlobals="false" | ||
backupStaticAttributes="false" | ||
colors="true" | ||
verbose="true" | ||
convertErrorsToExceptions="true" | ||
convertNoticesToExceptions="true" | ||
convertWarningsToExceptions="true" | ||
processIsolation="false" | ||
stopOnFailure="false"> | ||
<testsuites> | ||
<testsuite name="Unit"> | ||
<directory>tests/Unit</directory> | ||
</testsuite> | ||
<testsuite name="Integration"> | ||
<directory>tests/Integration</directory> | ||
</testsuite> | ||
</testsuites> | ||
<filter> | ||
<whitelist> | ||
<directory suffix=".php">src/</directory> | ||
</whitelist> | ||
</filter> | ||
|
||
<logging> | ||
<log type="tap" target="build/report.tap"/> | ||
<log type="junit" target="build/report.junit.xml"/> | ||
<log type="coverage-html" target="build/coverage"/> | ||
<log type="coverage-text" target="build/coverage.txt"/> | ||
<log type="coverage-clover" target="build/logs/clover.xml"/> | ||
</logging> | ||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" bootstrap="vendor/autoload.php" backupGlobals="false" colors="true" processIsolation="false" stopOnFailure="false" xsi:noNamespaceSchemaLocation="https://schema.phpunit.de/10.5/phpunit.xsd" backupStaticProperties="false"> | ||
<coverage> | ||
<report> | ||
<clover outputFile="build/logs/clover.xml"/> | ||
<html outputDirectory="build/coverage"/> | ||
<text outputFile="build/coverage.txt"/> | ||
</report> | ||
</coverage> | ||
<testsuites> | ||
<testsuite name="Unit"> | ||
<directory>tests/Unit</directory> | ||
</testsuite> | ||
<testsuite name="Integration"> | ||
<directory>tests/Integration</directory> | ||
</testsuite> | ||
</testsuites> | ||
<logging> | ||
<junit outputFile="build/report.junit.xml"/> | ||
</logging> | ||
<source> | ||
<include> | ||
<directory suffix=".php">src/</directory> | ||
</include> | ||
</source> | ||
</phpunit> |
Oops, something went wrong.