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); } exit(); } $domain = $this->argument('domain'); // adding flags $domainFlags = ''; // add file for domain $saved = []; system('certbot --non-interactive --agree-tos -m '.$this->argument('email').' --nginx -d '.$domain); // check for certificate if (file_exists( '/etc/letsencrypt/live/'.$domain.'/fullchain.pem')) { $this->info($domain.'...Success!'); } else { $this->error($domain.'...Failed!'); } } }