mirror of
https://github.com/PhyreApps/PhyrePanel.git
synced 2024-11-22 15:40:25 +00:00
38 lines
845 B
PHP
38 lines
845 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Models\Domain;
|
|
use Illuminate\Console\Command;
|
|
|
|
class RunDomainRepair extends Command
|
|
{
|
|
/**
|
|
* The name and signature of the console command.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $signature = 'phyre:run-domain-repair';
|
|
|
|
/**
|
|
* The console command description.
|
|
*
|
|
* @var string
|
|
*/
|
|
protected $description = 'Command description';
|
|
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle()
|
|
{
|
|
$getAllDomains = Domain::all();
|
|
if ($getAllDomains->count() > 0) {
|
|
foreach ($getAllDomains as $domain) {
|
|
$this->info('Repair domain: ' . $domain->domain);
|
|
$domain->configureVirtualHost(false);
|
|
}
|
|
shell_exec('service apache2 restart');
|
|
}
|
|
}
|
|
}
|