diff --git a/src/Illuminate/Foundation/Console/ListenerMakeCommand.php b/src/Illuminate/Foundation/Console/ListenerMakeCommand.php index 971d1b76327f..25e41e3fee49 100644 --- a/src/Illuminate/Foundation/Console/ListenerMakeCommand.php +++ b/src/Illuminate/Foundation/Console/ListenerMakeCommand.php @@ -53,8 +53,11 @@ protected function buildClass($name) { $event = $this->option('event'); - if (! Str::startsWith($event, $this->laravel->getNamespace()) && - ! Str::startsWith($event, 'Illuminate')) { + if (! Str::startsWith($event, [ + $this->laravel->getNamespace(), + 'Illuminate', + '\\', + ])) { $event = $this->laravel->getNamespace().'Events\\'.$event; }