diff --git a/NotifyToastrServiceProvider.php b/NotifyToastrServiceProvider.php index fd4c7583..9d866f24 100644 --- a/NotifyToastrServiceProvider.php +++ b/NotifyToastrServiceProvider.php @@ -31,9 +31,9 @@ class NotifyToastrServiceProvider extends ServiceProvider public function provides() { return array( - 'notify.producer', - 'notify.producer.toastr', - 'notify.renderer.toastr', + 'flasher.factory', + 'flasher.factory.toastr', + 'flasher.renderer.toastr', ); } diff --git a/ServiceProvider/Providers/Laravel.php b/ServiceProvider/Providers/Laravel.php index ed878ee7..e9631c68 100644 --- a/ServiceProvider/Providers/Laravel.php +++ b/ServiceProvider/Providers/Laravel.php @@ -5,7 +5,7 @@ namespace Flasher\Toastr\Laravel\ServiceProvider\Providers; use Flasher\Prime\Flasher; use Flasher\Prime\Renderer\RendererManager; use Flasher\Toastr\LaravelFlasher\PrimeToastrServiceProvider; -use Flasher\Toastr\Prime\Producer\ToastrProducer; +use Flasher\Toastr\Prime\Factory\ToastrProducer; use Flasher\Toastr\Prime\Renderer\ToastrRenderer; use Illuminate\Container\Container; use Illuminate\Foundation\Application; @@ -35,25 +35,25 @@ class Laravel implements ServiceProviderInterface public function registerNotifyToastrServices() { - $this->app->singleton('notify.producer.toastr', function (Container $app) { - return new ToastrProducer($app['notify.storage'], $app['notify.middleware']); + $this->app->singleton('flasher.factory.toastr', function (Container $app) { + return new ToastrProducer($app['flasher.storage'], $app['flasher.middleware']); }); - $this->app->singleton('notify.renderer.toastr', function (Container $app) { - return new ToastrRenderer($app['notify.config']); + $this->app->singleton('flasher.renderer.toastr', function (Container $app) { + return new ToastrRenderer($app['flasher.config']); }); - $this->app->alias('notify.producer.toastr', 'Flasher\Toastr\Prime\Producer\ToastrProducer'); - $this->app->alias('notify.renderer.toastr', 'Flasher\Toastr\Prime\Renderer\ToastrRenderer'); + $this->app->alias('flasher.factory.toastr', 'Flasher\Toastr\Prime\Factory\ToastrProducer'); + $this->app->alias('flasher.renderer.toastr', 'Flasher\Toastr\Prime\Renderer\ToastrRenderer'); - $this->app->extend('notify.producer', function (Flasher $manager, Container $app) { - $manager->addDriver('toastr', $app['notify.producer.toastr']); + $this->app->extend('flasher.factory', function (Flasher $manager, Container $app) { + $manager->addDriver('toastr', $app['flasher.factory.toastr']); return $manager; }); - $this->app->extend('notify.renderer', function (RendererManager $manager, Container $app) { - $manager->addDriver('toastr', $app['notify.renderer.toastr']); + $this->app->extend('flasher.renderer', function (RendererManager $manager, Container $app) { + $manager->addDriver('toastr', $app['flasher.renderer.toastr']); return $manager; }); @@ -61,10 +61,10 @@ class Laravel implements ServiceProviderInterface public function mergeConfigFromToastr() { - $notifyConfig = $this->app['config']->get('notify.adapters.toastr', array()); + $notifyConfig = $this->app['config']->get('flasher.adapters.toastr', array()); $toastrConfig = $this->app['config']->get('notify_toastr', array()); - $this->app['config']->set('notify.adapters.toastr', array_merge($toastrConfig, $notifyConfig)); + $this->app['config']->set('flasher.adapters.toastr', array_merge($toastrConfig, $notifyConfig)); } } diff --git a/tests/NotifyToastrServiceProviderTest.php b/tests/NotifyToastrServiceProviderTest.php index abb20739..c37f058d 100644 --- a/tests/NotifyToastrServiceProviderTest.php +++ b/tests/NotifyToastrServiceProviderTest.php @@ -6,13 +6,13 @@ class NotifyToastrServiceProviderTest extends TestCase { public function testContainerContainNotifyServices() { - $this->assertTrue($this->app->bound('notify.producer')); - $this->assertTrue($this->app->bound('notify.producer.toastr')); + $this->assertTrue($this->app->bound('flasher.factory')); + $this->assertTrue($this->app->bound('flasher.factory.toastr')); } public function testNotifyFactoryIsAddedToExtensionsArray() { - $manager = $this->app->make('notify.producer'); + $manager = $this->app->make('flasher.factory'); $reflection = new \ReflectionClass($manager); $property = $reflection->getProperty('drivers'); @@ -26,7 +26,7 @@ class NotifyToastrServiceProviderTest extends TestCase public function testConfigToastrInjectedInGlobalNotifyConfig() { - $manager = $this->app->make('notify.producer'); + $manager = $this->app->make('flasher.factory'); $reflection = new \ReflectionClass($manager); $property = $reflection->getProperty('config');