diff --git a/src/Service.php b/src/Service.php index 946a7e3..8b515df 100644 --- a/src/Service.php +++ b/src/Service.php @@ -60,7 +60,8 @@ function __construct(array $config) */ public function scheduledCommand(Event $event) { - $eventCommand = explode("'artisan' ", $event->command)[1]; + preg_match("/(artisan |'artisan' )(.*)/us", $event->command, $matches); + $eventCommand = $matches[2]; $event->sendOutputTo(base_path() . '/storage/logs/'.$eventCommand.'.txt'); if (is_null($event->output)) { diff --git a/src/ServiceProvider.php b/src/ServiceProvider.php index 3b3a061..c0751de 100644 --- a/src/ServiceProvider.php +++ b/src/ServiceProvider.php @@ -21,7 +21,9 @@ class ServiceProvider extends ServiceProviderParent public function boot() { //config - $this->publishes([__DIR__ . '/config.php' => config_path('slack-output.php')]); + if (class_exists('Illuminate\Foundation\Application', false)) { + $this->publishes([__DIR__ . '/config.php' => config_path('slack-output.php')]); + } //command $this->commands(