diff --git a/README.md b/README.md index 38a98ad..f451b50 100644 --- a/README.md +++ b/README.md @@ -49,11 +49,11 @@ composer update ``` ## Configuration -Add the ServiceProvider to your `providers` array in `app/config/app.php`: +Add the ServiceProvider to your `providers` array in `config/app.php`: 'Squigg\AzureQueueLaravel\AzureQueueServiceProvider', -add the following to the `connection` array in `app/config/queue.php`, set your `default` connection to `azure` and +add the following to the `connection` array in `config/queue.php`, set your `default` connection to `azure` and fill out your own connection data from the Azure Management portal: 'azure' => [ diff --git a/src/AzureQueueServiceProvider.php b/src/AzureQueueServiceProvider.php index 4a33889..246b616 100644 --- a/src/AzureQueueServiceProvider.php +++ b/src/AzureQueueServiceProvider.php @@ -3,25 +3,24 @@ namespace Squigg\AzureQueueLaravel; use Illuminate\Queue\QueueManager; +use Illuminate\Support\ServiceProvider; -class AzureQueueServiceProvider extends \Illuminate\Support\ServiceProvider +class AzureQueueServiceProvider extends ServiceProvider { /** - * Register the service provider. + * Bootstrap any application services. * * @return void */ - public function register() + public function boot() { - $this->app->booted(function () { + /** @var QueueManager $manager */ + $manager = $this->app['queue']; - /** @var QueueManager $manager */ - $manager = $this->app['queue']; - - $manager->addConnector('azure', function () { - return new AzureConnector; - }); + $manager->addConnector('azure', function () { + return new AzureConnector; }); } + }