Installing and managing modules from admin panel (#847)

This commit is contained in:
Yash Govekar
2020-10-19 10:10:28 -04:00
committed by GitHub
parent ca220f1cdf
commit 5803487d51
92 changed files with 1259 additions and 669 deletions
@@ -0,0 +1,30 @@
<?php
namespace App\Services\Importers;
use App\Repositories\SettingRepository;
class SettingsImporter extends BaseImporter
{
protected $table = 'settings';
public function run($start = 0)
{
$this->comment('--- SETTINGS IMPORT ---');
/** @var SettingRepository $settingsRepo */
$settingsRepo = app(SettingRepository::class);
$count = 0;
$rows = $this->db->readRows($this->table, $this->idField, $start);
foreach ($rows as $row) {
switch ($row->name) {
case 'ADMIN_EMAIL':
$settingsRepo->store('general.admin_email', $row->value);
break;
}
}
$this->info('Imported '.$count.' settings');
}
}