This repository has been archived on 2024-04-08. You can view files and clone it, but cannot push or open issues or pull requests.
site-base/database/seeds/CountryTableSeeder.php

27 lines
454 B
PHP
Raw Permalink Normal View History

<?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);
}
}