/** * Run the database seeds. * * @return void */ public function run() { Currencies::create(['name' => 'USD', 'rate' => '1.0', 'icon' => '$', 'default' => true]); $this->command->info('Currencies table seeded!'); }
public function getCurrencies() { $currencies = Currencies::get(); $arr = []; if ($currencies->count()) { foreach ($currencies as $value) { $arr[$value->name] = $value->rate; } } return $arr; }