osb/database/seeders/CountryTableSeeder.php

29 lines
465 B
PHP
Raw Normal View History

<?php
2021-06-30 01:06:20 +00:00
namespace Database\Seeders;
use Illuminate\Database\Seeder;
2018-06-18 11:51:20 +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;
2022-02-01 09:15:11 +00:00
$oo = Currency::where('iso','AUD')->firstOrFail();
2021-12-17 03:59:55 +00:00
$oo->country()->save($o);
2018-06-18 11:51:20 +00:00
}
}