From 6d6be8b80228e135cde85e083984b81ef7416e53 Mon Sep 17 00:00:00 2001 From: Adam Marshall Date: Fri, 18 May 2018 13:26:29 -0700 Subject: [PATCH] Adds support for Laravel 5.6 and implemented automatic package discovery. Updated readme with a few grammatical changes and explaining the auto package discovery feature. Fixes #6 --- README.md | 17 ++++++++++++----- composer.json | 13 ++++++++++--- src/SlackEventsServiceProvider.php | 2 +- 3 files changed, 23 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index d04b87e..80c05aa 100644 --- a/README.md +++ b/README.md @@ -20,7 +20,9 @@ ```bash composer require lisennk/laravel-slack-events-api ``` -**2)** Open `config/app.php` and add `\Lisennk\LaravelSlackEvents\SlackEventsServiceProvider::class` to the `providers[]` array. +**2)** If you're using Laravel version 5.5 or higher, the SlackEventsServiceProvider will be automatically discovered. Get started fast! + +**3)** If you're using a version of Laravel lower than 5.5, you'll still have to register the service provider manually. Open `config/app.php` and add `\Lisennk\LaravelSlackEvents\SlackEventsServiceProvider::class` to the `providers[]` array. *For example:* ```php @@ -36,16 +38,21 @@ composer require lisennk/laravel-slack-events-api // ... ``` -If you are using Laravel 5.3, in this file you will find a comment with text like `/* Package Service Providers... */`, which can help you to find the right place. +If you are using Laravel 5.3 or higher, you will find a comment in `config/app.php` with text like `/* Package Service Providers... */`, which can help you find the right place. -**3)** Publish the config file +**4)** Publish the config file ```bash php artisan vendor:publish + ``` -**4)** Open in browser [api.slack.com](https://api.slack.com) site, go to "[My Apps](https://api.slack.com/apps)" page and then go to your app control panel. You will need to configure a few things here in the next 2 steps. +Choose the option for the Service Provider, or find `slack-events` in the `Tag:` list at the bottom. + +Next we'll configure some settings to use the [Slack API](https://api.slack.com). + +**5)** Open the [Slack Apps](https://api.slack.com/apps) page and either create a new App, or open an existing app you're modifying to use with Slack-Events. -**5)** Go to the "App Credentials" page, scroll down and copy "Verification Token". +**6)** Once you're on the *Basic Information* page for your selected App, scroll down to the "App Credentials" section, and copy the *Verification Token* at the bottom. verification_token diff --git a/composer.json b/composer.json index 115d115..01da189 100644 --- a/composer.json +++ b/composer.json @@ -3,9 +3,9 @@ "description": "Slack Events API for Laravel 5", "keywords": ["slack", "laravel", "api", "slack api", "slack events api", "events", "slack events"], "require": { - "illuminate/http": "5.1.*|5.2.*|5.3.*|5.4.*", - "illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*", - "illuminate/routing": "5.1.*|5.2.*|5.3.*|5.4.*" + "illuminate/http": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*", + "illuminate/support": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*", + "illuminate/routing": "5.1.*|5.2.*|5.3.*|5.4.*|5.5.*|5.6.*" }, "require-dev": { "phpunit/phpunit": "^4.7|^5.0", @@ -21,6 +21,13 @@ "Lisennk\\LaravelSlackEvents\\Tests\\": "tests/" } }, + "extra": { + "laravel": { + "providers": [ + "Lisennk\\LaravelSlackEvents\\SlackEventsServiceProvider" + ] + } + }, "license": "MIT", "authors": [ { diff --git a/src/SlackEventsServiceProvider.php b/src/SlackEventsServiceProvider.php index 35ff187..7f4cb13 100644 --- a/src/SlackEventsServiceProvider.php +++ b/src/SlackEventsServiceProvider.php @@ -23,7 +23,7 @@ public function boot() $source = dirname(__DIR__).'/config/slackEvents.php'; if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { - $this->publishes([$source => config_path('slackEvents.php')]); + $this->publishes([$source => config_path('slackEvents.php')], 'slack-events'); } elseif ($this->app instanceof LumenApplication) { $this->app->configure('slackEvents'); }