|
@ -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(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|