diff --git a/src/Http/Validation/Custom/ArtisanCommand.php b/src/Http/Validation/Custom/ArtisanCommand.php index 052a40294..19b4dde5d 100644 --- a/src/Http/Validation/Custom/ArtisanCommand.php +++ b/src/Http/Validation/Custom/ArtisanCommand.php @@ -21,9 +21,8 @@ */ namespace Seat\Web\Http\Validation\Custom; -use Symfony\Component\Console\Input\ArgvInput; + use Artisan; -use Symfony\Component\Console\Exception\RuntimeException; /** * Class ArtisanCommand. @@ -43,17 +42,20 @@ class ArtisanCommand */ public static function validate($attribute, $value, $parameters, $validator) { + //get all commands $allCommands = Artisan::all(); - $argv = explode(" ",$value); + //split arguments + $argv = explode(' ', $value); + //get command name and check if it exists $commandName = $argv[0] ?? null; - if($commandName===null) return false; - if(!array_key_exists($commandName,$allCommands)) return false; + if($commandName === null) return false; + if(! array_key_exists($commandName, $allCommands)) return false; //I haven't found a way to validate the arguments, so we assume they are alright - + //all checks have passed, we can allow it return true; } } diff --git a/src/Http/Validation/NewSchedule.php b/src/Http/Validation/NewSchedule.php index c678bff03..bfeecfd15 100644 --- a/src/Http/Validation/NewSchedule.php +++ b/src/Http/Validation/NewSchedule.php @@ -22,7 +22,6 @@ namespace Seat\Web\Http\Validation; -use Artisan; use Illuminate\Foundation\Http\FormRequest; /**