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

14 lines
314 B
PHP

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