Browse Source

adding #45

master
Björn 4 years ago
parent
commit
de3a1feba3
1 changed files with 5 additions and 14 deletions
  1. +5
    -14
      app/Commands/LetsEncryptAddCommand.php

+ 5
- 14
app/Commands/LetsEncryptAddCommand.php View File

@ -3,9 +3,11 @@
namespace App\Commands; namespace App\Commands;
use Illuminate\Console\Scheduling\Schedule; use Illuminate\Console\Scheduling\Schedule;
use Illuminate\Support\Facades\Validator;
use LaravelZero\Framework\Commands\Command; use LaravelZero\Framework\Commands\Command;
use Respect\Validation\Validator as v;
use Respect\Validation\Exceptions\NestedValidationException;
/** /**
* Add LetsEncrypt Certificate * Add LetsEncrypt Certificate
* *
@ -41,19 +43,8 @@ class LetsEncryptAddCommand extends Command
{ {
$email = $this->argument('email'); $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(); exit();
} }


Loading…
Cancel
Save