osb/database/seeds/CountryTableSeeder.php
2018-04-10 21:35:29 +10:00

27 lines
454 B
PHP

<?php
use Illuminate\Database\Seeder;
use App\Models\{Country,Currency};
class CountryTableSeeder extends Seeder
{
/**
* Run the database seeds.
*
* @return void
*/
public function run()
{
$o = new Country;
$o->name = 'Australia';
$o->twocode = 'AU';
$o->threecode = 'AUS';
$o->currency_id = '61';
$o->active = TRUE;
$oo = Currency::where('threecode','AUD')->firstOrFail();
$oo->countries()->save($o);
}
}