| 1 | <?php |
||
| 2 | |||
| 3 | /** |
||
| 4 | * This Driver is a Laravel integration for the package php-mattermost-driver |
||
| 5 | * (https://github.com/gnello/php-mattermost-driver) |
||
| 6 | * |
||
| 7 | * For the full copyright and license information, please read the LICENSE.txt |
||
| 8 | * file that was distributed with this source code. For the full list of |
||
| 9 | * contributors, visit https://github.com/gnello/laravel-mattermost-driver/contributors |
||
| 10 | * |
||
| 11 | * God bless this mess too. |
||
| 12 | * |
||
| 13 | * @author Luca Agnello <[email protected]> |
||
| 14 | * @link https://api.mattermost.com/ |
||
| 15 | */ |
||
| 16 | |||
| 17 | namespace Gnello\Mattermost\Laravel; |
||
| 18 | |||
| 19 | use Illuminate\Support\ServiceProvider; |
||
| 20 | |||
| 21 | /** |
||
| 22 | * Class MattermostServiceProvider |
||
| 23 | * |
||
| 24 | * @package Gnello\Mattermost |
||
| 25 | */ |
||
| 26 | class MattermostServiceProvider extends ServiceProvider |
||
| 27 | { |
||
| 28 | /** |
||
| 29 | * Bootstrap the application services. |
||
| 30 | * |
||
| 31 | * @return void |
||
| 32 | */ |
||
| 33 | public function boot() |
||
| 34 | { |
||
| 35 | $this->publishes([ |
||
| 36 | __DIR__.'/config/mattermost.php' => config_path('mattermost.php'), |
||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||
| 37 | ]); |
||
| 38 | } |
||
| 39 | |||
| 40 | /** |
||
| 41 | * Register the application services. |
||
| 42 | * |
||
| 43 | * @return void |
||
| 44 | */ |
||
| 45 | public function register() |
||
| 46 | { |
||
| 47 | $this->mergeConfigFrom( |
||
| 48 | __DIR__.'/config/mattermost.php', 'mattermost' |
||
| 49 | ); |
||
| 50 | |||
| 51 | $this->app->singleton('mattermost', function($app) { |
||
| 52 | return new Driver($app); |
||
| 53 | }); |
||
| 54 | |||
| 55 | $this->app->bind('mattermost.server', function ($app) { |
||
| 56 | return $app['mattermost']->server(); |
||
| 57 | }); |
||
| 58 | } |
||
| 59 | } |
||
| 60 |