From 938c7174fbd600911ee869f531a44b855f263d16 Mon Sep 17 00:00:00 2001
From: Juan Carlos Alonso <me@jcalonso.com>
Date: Thu, 28 Jan 2016 23:45:45 +0000
Subject: [PATCH] Fixed issue when artisan command is not wrapped around single
 quotes

---
 src/Service.php | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

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)) {