diff --git a/app/Commands/LetsEncryptAddCommand.php b/app/Commands/LetsEncryptAddCommand.php index ebb1750..fdf7492 100644 --- a/app/Commands/LetsEncryptAddCommand.php +++ b/app/Commands/LetsEncryptAddCommand.php @@ -3,9 +3,11 @@ namespace App\Commands; use Illuminate\Console\Scheduling\Schedule; -use Illuminate\Support\Facades\Validator; use LaravelZero\Framework\Commands\Command; +use Respect\Validation\Validator as v; +use Respect\Validation\Exceptions\NestedValidationException; + /** * Add LetsEncrypt Certificate * @@ -41,19 +43,8 @@ class LetsEncryptAddCommand extends Command { $email = $this->argument('email'); - // email for validator - $validator = Validator::make([ - 'email' => $email - ], [ - 'email' => ['email'], - ]); - - // show if error if first argument is not a email - if ($validator->fails()) { - foreach ($validator->errors()->all() as $error) { - $this->error($error); - } - + if (!v::email()->validate($email)) { + $this->error('First argument has to be a valid E-Mail! Failed!'); exit(); }