osb/database/factories/AccountFactory.php
2020-02-12 21:57:44 +11:00

15 lines
357 B
PHP

<?php
use Faker\Generator as Faker;
$factory->define(App\Models\Account::class, function (Faker $faker) {
return [
'id'=>1,
];
});
$factory->afterMaking(App\Models\Account::class, function ($service,$faker) {
$country = factory(App\Models\Country::class)->make();
$service->setRelation('country',$country);
$service->country_id = $country->id;
});