phpvms/modules/Importer/Services/Importers/SettingsImporter.php
Nabeel S 14aacdfb75
Import expense and ledger entries #443 (#588)
* Fix rank importing with PIREP pay #443

* Import ledger information #443

* Uncomment out testing importers

* Import expense log and settings #443

* Formatting
2020-02-25 14:45:23 -05:00

32 lines
814 B
PHP

<?php
namespace Modules\Importer\Services\Importers;
use App\Repositories\SettingRepository;
use Modules\Importer\Services\BaseImporter;
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');
}
}