Merge pull request #2731 from SteffenMahler/patch-5

add CartRuleCouponFactory
This commit is contained in:
Jitendra Singh 2020-03-23 13:49:06 +05:30 committed by GitHub
commit 6380d9096e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 20 additions and 0 deletions

View File

@ -0,0 +1,20 @@
<?php
/** @var \Illuminate\Database\Eloquent\Factory $factory */
use Faker\Generator as Faker;
use Webkul\CartRule\Models\CartRule;
use Webkul\CartRule\Models\CartRuleCoupon;
$factory->define(CartRuleCoupon::class, function (Faker $faker) {
return [
'code' => $faker->uuid(),
'usage_limit' => 100,
'usage_per_customer' => 100,
'type' => 0,
'is_primary' => 1,
'cart_rule_id' => static function () {
return factory(CartRule::class)->create()->id;
},
];
});