33namespace LaravelQueueManager \Providers ;
44
55use Illuminate \Console \Scheduling \Schedule ;
6- use Illuminate \Support \Facades \View ;
76use Illuminate \Support \ServiceProvider ;
87use LaravelQueueManager \Console \Commands \GenerateConfigCommand ;
98use LaravelQueueManager \Console \Commands \GenerateQueueCommand ;
@@ -31,7 +30,7 @@ public function boot()
3130 __DIR__ . '/../migrations/2016_10_21_153409_queue_config_add_connection.php ' => database_path ('migrations/2016_10_21_153409_queue_config_add_connection.php ' ),
3231 ]);
3332
34- View::addNamespace ('laravel_queue_manager ' , __DIR__ . '/../resources/views ' );
33+ \ View::addNamespace ('laravel_queue_manager ' , __DIR__ . '/../resources/views ' );
3534
3635 $ this ->schedule ();
3736 $ this ->commands ('queue-manager.generate-config ' );
@@ -75,21 +74,20 @@ public function register()
7574 */
7675 protected function registerCommand ()
7776 {
78- $ this ->app [ 'queue-manager.generate-config ' ] = $ this -> app -> share ( function () {
77+ $ this ->app -> singleton ( 'queue-manager.generate-config ' , function () {
7978 return new GenerateConfigCommand ();
8079 });
8180
82- $ this ->app [ 'queue-manager.generate-queue ' ] = $ this -> app -> share ( function () {
81+ $ this ->app -> singleton ( 'queue-manager.generate-queue ' , function () {
8382 return new GenerateQueueCommand ();
8483 });
8584
86- $ this ->app [ 'queue-manager.show-jobs ' ] = $ this -> app -> share ( function () {
85+ $ this ->app -> singleton ( 'queue-manager.show-jobs ' , function () {
8786 return new ShowJobsCommand ();
8887 });
8988
90- $ this ->app [ 'queue-manager.work ' ] = $ this -> app -> share ( function () {
89+ $ this ->app -> singleton ( 'queue-manager.work ' , function () {
9190 return new WorkCommand (new Worker (resolve ('Illuminate\Queue\QueueManager ' ), resolve ('Illuminate\Contracts\Events\Dispatcher ' ), resolve ('Illuminate\Contracts\Debug\ExceptionHandler ' )));
9291 });
93-
9492 }
9593}
0 commit comments