Add missing test factories
This commit is contained in:
@@ -4,16 +4,18 @@ use Faker\Generator as Faker;
|
||||
|
||||
$factory->define(App\Models\Service::class, function (Faker $faker) {
|
||||
return [
|
||||
'account_id'=>1,
|
||||
'active'=>1,
|
||||
];
|
||||
});
|
||||
|
||||
$factory->afterMaking(App\Models\Service::class, function ($service,$faker) {
|
||||
$product = factory(App\Models\Product::class)->make();
|
||||
|
||||
$service->setRelation('product',$product);
|
||||
$service->product_id = $product->id;
|
||||
|
||||
$account = factory(App\Models\Account::class)->make();
|
||||
$service->setRelation('account',$account);
|
||||
$service->account_id = $account->id;
|
||||
});
|
||||
|
||||
// Weekly
|
||||
|
Reference in New Issue
Block a user