diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 8075e2a..ae7c7b2 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -2,7 +2,7 @@ Contributions are **welcome** and will be fully **credited**. -We accept contributions via Pull Requests on [Github](https://github.com/aloha/laravel-twilio). +We accept contributions via Pull Requests on [Github](https://github.com/fleetbase/laravel-twilio). ## Pull Requests diff --git a/README.md b/README.md index 0211f62..5d90d58 100644 --- a/README.md +++ b/README.md @@ -2,17 +2,17 @@ laravel-twilio =============== Laravel Twilio API Integration -[![Build Status](https://img.shields.io/travis/aloha/laravel-twilio.svg?style=flat-square)](https://travis-ci.org/aloha/laravel-twilio) -[![Total Downloads](https://img.shields.io/packagist/dt/aloha/twilio.svg?style=flat-square)](https://packagist.org/packages/aloha/twilio) -[![Latest Stable Version](https://img.shields.io/packagist/v/aloha/twilio.svg?style=flat-square)](https://packagist.org/packages/aloha/twilio) -[![License](https://img.shields.io/github/license/aloha/laravel-twilio?style=flat-square)](#license) +[![Build Status](https://img.shields.io/travis/fleetbase/laravel-twilio.svg?style=flat-square)](https://travis-ci.org/fleetbase/laravel-twilio) +[![Total Downloads](https://img.shields.io/packagist/dt/fleetbase/twilio.svg?style=flat-square)](https://packagist.org/packages/fleetbase/twilio) +[![Latest Stable Version](https://img.shields.io/packagist/v/fleetbase/twilio.svg?style=flat-square)](https://packagist.org/packages/fleetbase/twilio) +[![License](https://img.shields.io/github/license/fleetbase/laravel-twilio?style=flat-square)](#license) ## Installation Begin by installing this package through Composer. Run this command from the Terminal: ```bash -composer require aloha/twilio +composer require fleetbase/twilio ``` This will register two new artisan commands for you: @@ -22,25 +22,25 @@ This will register two new artisan commands for you: And make these objects resolvable from the IoC container: -- `Aloha\Twilio\Manager` (aliased as `twilio`) -- `Aloha\Twilio\TwilioInterface` (resolves a `Twilio` object, the default connection object created by the `Manager`). +- `Fleetbase\Twilio\Manager` (aliased as `twilio`) +- `Fleetbase\Twilio\TwilioInterface` (resolves a `Twilio` object, the default connection object created by the `Manager`). There's a Facade class available for you, if you like. In your `app.php` config file add the following line to the `aliases` array if you want to use a short class name: ```php -'Twilio' => 'Aloha\Twilio\Support\Laravel\Facade', +'Twilio' => 'Fleetbase\Twilio\Support\Laravel\Facade', ``` You can publish the default config file to `config/twilio.php` with the terminal command ```shell -php artisan vendor:publish --provider="Aloha\Twilio\Support\Laravel\ServiceProvider" +php artisan vendor:publish --provider="Fleetbase\Twilio\Support\Laravel\ServiceProvider" ``` #### Facade -The facade has the exact same methods as the `Aloha\Twilio\TwilioInterface`. First, include the `Facade` class at the top of your file: +The facade has the exact same methods as the `Fleetbase\Twilio\TwilioInterface`. First, include the `Facade` class at the top of your file: ```php use Twilio; @@ -63,10 +63,10 @@ Define multiple entries in your `twilio` [config file](src/config/config.php) to ### Usage -Creating a Twilio object. This object implements the `Aloha\Twilio\TwilioInterface`. +Creating a Twilio object. This object implements the `Fleetbase\Twilio\TwilioInterface`. ```php -$twilio = new Aloha\Twilio\Twilio($accountId, $token, $fromNumber); +$twilio = new Fleetbase\Twilio\Twilio($accountId, $token, $fromNumber); ``` Sending a text message: @@ -131,12 +131,12 @@ $twilio->call($to, $message, $params); #### Dummy class -There is a dummy implementation of the `TwilioInterface` available: `Aloha\Twilio\Dummy`. This class +There is a dummy implementation of the `TwilioInterface` available: `Fleetbase\Twilio\Dummy`. This class allows you to inject this instead of a working implementation in case you need to run quick integration tests. #### Logging decorator -There is one more class available for you: the `Aloha\Twilio\LoggingDecorator`. This class wraps any +There is one more class available for you: the `Fleetbase\Twilio\LoggingDecorator`. This class wraps any `TwilioInterface` object and logs whatever Twilio will do for you. It also takes a `Psr\Log\LoggerInterface` object (like Monolog) for logging, you know. @@ -146,10 +146,10 @@ but it is at your disposal in case you want it. A possible use case is to constr ```php if (getenv('APP_ENV') === 'production') { - $twilio = $container->make(\Aloha\Twilio\Manager::class); + $twilio = $container->make(\Fleetbase\Twilio\Manager::class); } else { $psrLogger = $container->make(\Psr\Log\LoggerInterface::class); - $twilio = new LoggingDecorator($psrLogger, new \Aloha\Twilio\Dummy()); + $twilio = new LoggingDecorator($psrLogger, new \Fleetbase\Twilio\Dummy()); } // Inject it wherever you want. diff --git a/composer.json b/composer.json index 31cf725..a2c88f5 100644 --- a/composer.json +++ b/composer.json @@ -1,9 +1,14 @@ { - "name": "aloha/twilio", + "name": "fleetbase/twilio", "description": "Twilio API for Laravel", + "version": "5.0.1", "type": "library", "keywords": ["sms", "ivr", "laravel", "twilio"], "authors": [ + { + "name": "Ronald A Richardson", + "email": "ron@fleetbase.io" + }, { "name": "Travis J Ryan", "email": "travisjryan@gmail.com" @@ -13,7 +18,7 @@ "email": "vandevreken.hannes@gmail.com" } ], - "homepage":"https://github.com/aloha/laravel-twilio", + "homepage":"https://github.com/fleetbase/laravel-twilio", "license": "MIT", "require": { "php": ">=7.2.0", @@ -27,12 +32,12 @@ }, "autoload": { "psr-4": { - "Aloha\\Twilio\\": "src/" + "Fleetbase\\Twilio\\": "src/" } }, "autoload-dev": { "psr-4": { - "Aloha\\Twilio\\Tests\\": "tests/" + "Fleetbase\\Twilio\\Tests\\": "tests/" } }, "scripts": { @@ -51,10 +56,10 @@ "extra": { "laravel": { "providers": [ - "Aloha\\Twilio\\Support\\Laravel\\ServiceProvider" + "Fleetbase\\Twilio\\Support\\Laravel\\ServiceProvider" ], "aliases": { - "Twilio": "Aloha\\Twilio\\Support\\Laravel\\Facade" + "Twilio": "Fleetbase\\Twilio\\Support\\Laravel\\Facade" } } } diff --git a/src/Commands/TwilioCallCommand.php b/src/Commands/TwilioCallCommand.php index 8381822..7d4ba75 100644 --- a/src/Commands/TwilioCallCommand.php +++ b/src/Commands/TwilioCallCommand.php @@ -1,8 +1,8 @@ sid = $sid; $this->token = $token; diff --git a/src/TwilioInterface.php b/src/TwilioInterface.php index d0ca451..cffae4b 100644 --- a/src/TwilioInterface.php +++ b/src/TwilioInterface.php @@ -1,6 +1,6 @@ createMock('Aloha\Twilio\TwilioInterface'); + $stub = $this->createMock('Fleetbase\Twilio\TwilioInterface'); $command = new TwilioCallCommand($stub); // Act diff --git a/tests/TwilioSmsCommandTest.php b/tests/TwilioSmsCommandTest.php index d8dbf51..9e640b7 100644 --- a/tests/TwilioSmsCommandTest.php +++ b/tests/TwilioSmsCommandTest.php @@ -1,8 +1,8 @@ createMock('Aloha\Twilio\TwilioInterface'); + $stub = $this->createMock('Fleetbase\Twilio\TwilioInterface'); $command = new TwilioSmsCommand($stub); // Act