2018-04-10 11:23:13 +00:00
|
|
|
<?php
|
|
|
|
|
2021-06-30 01:06:20 +00:00
|
|
|
namespace Database\Seeders;
|
|
|
|
|
2018-04-10 11:23:13 +00:00
|
|
|
use Illuminate\Database\Seeder;
|
2018-06-18 11:51:20 +00:00
|
|
|
|
2018-04-10 11:23:13 +00:00
|
|
|
use App\Models\{Country,Currency};
|
|
|
|
|
|
|
|
class CountryTableSeeder extends Seeder
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the database seeds.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
2018-06-18 11:51:20 +00:00
|
|
|
public function run()
|
|
|
|
{
|
|
|
|
$o = new Country;
|
2018-07-06 06:57:49 +00:00
|
|
|
$o->id = 61;
|
2018-06-18 11:51:20 +00:00
|
|
|
$o->name = 'Australia';
|
|
|
|
$o->two_code = 'AU';
|
|
|
|
$o->three_code = 'AUS';
|
|
|
|
$o->active = TRUE;
|
2018-04-10 11:23:13 +00:00
|
|
|
|
2018-06-18 11:51:20 +00:00
|
|
|
$oo = Currency::where('iso_code','AUD')->firstOrFail();
|
2018-04-10 11:23:13 +00:00
|
|
|
|
2021-12-17 03:59:55 +00:00
|
|
|
$oo->country()->save($o);
|
2018-06-18 11:51:20 +00:00
|
|
|
}
|
|
|
|
}
|