2020-02-26 03:45:23 +08:00
|
|
|
<?php
|
|
|
|
|
2020-10-19 22:10:28 +08:00
|
|
|
namespace App\Services\Importers;
|
2020-02-26 03:45:23 +08:00
|
|
|
|
|
|
|
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');
|
|
|
|
}
|
|
|
|
}
|