This commit is contained in:
Bozhidar 2024-09-30 13:45:47 +03:00
parent c52d63b7af
commit 5fd2460aa2
2 changed files with 12 additions and 0 deletions

View file

@ -8,6 +8,7 @@ use App\PhyreConfig;
use App\UniversalDatabaseExecutor;
use Illuminate\Console\Command;
use Illuminate\Support\Facades\Blade;
use Modules\Email\App\Models\DomainDkim;
use Modules\LetsEncrypt\Models\LetsEncryptCertificate;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

View file

@ -3,6 +3,7 @@
namespace Modules\Email\App\Http\Livewire;
use Livewire\Component;
use Modules\Email\App\Models\DomainDkim;
use Modules\Email\DkimDomainSetup;
class DkimSetup extends Component
@ -80,6 +81,16 @@ class DkimSetup extends Component
public function secure()
{
$output = DkimDomainSetup::run($this->domain);
if (isset($output['privateKey'])) {
$findDomainDkim = DomainDkim::where('domain_name', $this->domain)->first();
if (!$findDomainDkim) {
$findDomainDkim = new DomainDkim();
$findDomainDkim->domain_name = $this->domain;
}
$findDomainDkim->private_key = $output['privateKey'];
$findDomainDkim->public_key = $output['text'];
$findDomainDkim->save();
}
return $output;
}