Merge pull request #3195 from jitendra-webkul/1.0

Replace array_random function to Arr:random
This commit is contained in:
Jitendra Singh 2020-06-09 13:26:37 +05:30 committed by GitHub
commit 415e58669c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -4,6 +4,7 @@
use Faker\Generator as Faker;
use Webkul\Customer\Models\Customer;
use Illuminate\Support\Arr;
use Webkul\Customer\Models\CustomerAddress;
$factory->define(CustomerAddress::class, function (Faker $faker) {
@ -24,7 +25,7 @@ $factory->define(CustomerAddress::class, function (Faker $faker) {
'city' => $faker->city,
'postcode' => $faker->postcode,
'phone' => $faker->e164PhoneNumber,
'default_address' => array_random([0, 1]),
'default_address' => Arr::random([0, 1]),
'address_type' => CustomerAddress::ADDRESS_TYPE,
];
});

View File

@ -4,6 +4,7 @@
use Faker\Generator as Faker;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Arr;
use Webkul\Customer\Models\Customer;
$factory->define(Customer::class, function (Faker $faker) {
@ -13,7 +14,7 @@ $factory->define(Customer::class, function (Faker $faker) {
return [
'first_name' => $faker->firstName(),
'last_name' => $faker->lastName,
'gender' => array_random(['male', 'female', 'other']),
'gender' => Arr::random(['male', 'female', 'other']),
'email' => $faker->email,
'status' => 1,
'password' => Hash::make($password),