mirror of
https://github.com/vitodeploy/vito.git
synced 2025-07-03 06:56:15 +00:00
#591 - sites
This commit is contained in:
@ -9,6 +9,7 @@
|
||||
use App\Models\Site;
|
||||
use App\Models\Ssl;
|
||||
use App\SSH\Services\Webserver\Webserver;
|
||||
use Illuminate\Support\Facades\Validator;
|
||||
use Illuminate\Validation\Rule;
|
||||
use Illuminate\Validation\ValidationException;
|
||||
|
||||
@ -21,6 +22,8 @@ class CreateSSL
|
||||
*/
|
||||
public function create(Site $site, array $input): void
|
||||
{
|
||||
Validator::make($input, self::rules($input))->validate();
|
||||
|
||||
$site->ssls()
|
||||
->where('type', $input['type'])
|
||||
->where('status', SslStatus::FAILED)
|
||||
|
15
app/Actions/SSL/DeactivateSSL.php
Normal file
15
app/Actions/SSL/DeactivateSSL.php
Normal file
@ -0,0 +1,15 @@
|
||||
<?php
|
||||
|
||||
namespace App\Actions\SSL;
|
||||
|
||||
use App\Models\Ssl;
|
||||
|
||||
class DeactivateSSL
|
||||
{
|
||||
public function deactivate(Ssl $ssl): void
|
||||
{
|
||||
$ssl->is_active = false;
|
||||
$ssl->save();
|
||||
$ssl->site->webserver()->updateVHost($ssl->site);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user