app->singleton('flashmessage', function (Container $app) { return new Messager($app['config']['flashmessage']); }); $this->app->alias('flashmessage', Messager::class); } public function boot() { $configSource = __DIR__.'/../config/flashmessage.php'; if ($this->app instanceof LaravelApplication && $this->app->runningInConsole()) { $this->publishes([$configSource => config_path('flashmessage.php')]); } elseif ($this->app instanceof LumenApplication) { $this->app->configure('flashmessage'); } $this->mergeConfigFrom($configSource, 'flashmessage'); $this->publishes([ realpath(__DIR__.'/../resources/views') => $this->app->basePath('resources/views/vendor/flashmessage'), ], 'view'); $this->loadViewsFrom(__DIR__.'/../resources/views', 'flashmessage'); } public function provides() { return ['flashmessage']; } }