Add missing test factories

This commit is contained in:
Deon George
2020-02-12 21:57:44 +11:00
parent 5cc0dcd8e1
commit c5f171da95
4 changed files with 44 additions and 2 deletions

View File

@@ -0,0 +1,15 @@
<?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;
});