diff --git a/src/Illuminate/Foundation/Console/ChannelMakeCommand.php b/src/Illuminate/Foundation/Console/ChannelMakeCommand.php index 7a539a21f7f2..8cfb3da8b559 100644 --- a/src/Illuminate/Foundation/Console/ChannelMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ChannelMakeCommand.php @@ -25,7 +25,22 @@ class ChannelMakeCommand extends GeneratorCommand * * @var string */ - protected $type = 'Broadcasting Channel'; + protected $type = 'Channel'; + + /** + * Build the class with the given name. + * + * @param string $name + * @return string + */ + protected function buildClass($name) + { + return str_replace( + 'DummyUser', + class_basename(config('auth.providers.users.model')), + parent::buildClass($name) + ); + } /** * Get the stub file for the generator. diff --git a/src/Illuminate/Foundation/Console/stubs/channel.stub b/src/Illuminate/Foundation/Console/stubs/channel.stub index b5c1b8b93e36..a44fa2a945b9 100644 --- a/src/Illuminate/Foundation/Console/stubs/channel.stub +++ b/src/Illuminate/Foundation/Console/stubs/channel.stub @@ -2,10 +2,12 @@ namespace DummyNamespace; +use NamespacedDummyUserModel; + class DummyClass { /** - * Create a new broadcasting channel instance. + * Create a new channel instance. * * @return void */ @@ -17,9 +19,10 @@ class DummyClass /** * Authenticates the channel. * - * @return mixed + * @param \NamespacedDummyUserModel $user + * @return array|bool */ - public function join() + public function join(DummyUser $user) { // } diff --git a/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php b/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php index 092b1656f1b4..6fe0655a9848 100755 --- a/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php +++ b/src/Illuminate/Foundation/Providers/ArtisanServiceProvider.php @@ -244,6 +244,18 @@ protected function registerCacheTableCommand() }); } + /** + * Register the command. + * + * @return void + */ + protected function registerChannelMakeCommand() + { + $this->app->singleton('command.channel.make', function ($app) { + return new ChannelMakeCommand($app['files']); + }); + } + /** * Register the command. * @@ -400,18 +412,6 @@ protected function registerJobMakeCommand() }); } - /** - * Register the command. - * - * @return void - */ - protected function registerChannelMakeCommand() - { - $this->app->singleton('command.channel.make', function ($app) { - return new ChannelMakeCommand($app['files']); - }); - } - /** * Register the command. *