define(App\Models\User::class, function (Faker $faker) { $name = $faker->firstName($gender = 'male'|'female'); $surname = $faker->lastName; $countryCodes = array(); foreach(country()->all() as $cCode => $cName) { array_push($countryCodes, $cCode); } return [ 'name' => $name, 'surname' => $surname, 'username' => $faker->userName, 'password' => '$2y$10$TKh8H1.PfQx37YgCzwiKb.KjNyWgaHb9cbcoQgdIVFlYg7B77UdFm', // secret, 'email' => $faker->unique()->safeEmail, 'country_code' => $faker->randomElement($array = $countryCodes), 'mobile_number' => $faker->phoneNumber, 'role_id' => $faker->randomElement($array = array(1, 2, 3, 4)), 'is_active' => $faker->boolean, 'is_confirmed' => $faker->boolean ]; }); $factory->afterCreating(\App\Models\User::class, function ($user, $faker) { $user->userProfile()->create([ "user_id" => $user->id, "profile_link" => $user->generateProfileLink($user->name, $user->surname), "technoblog_email" => $user->generateTechnoblogEmail($user->name, $user->surname), "facebook_link" => $user->generateProfileLink($user->name, $user->surname), "instagram_link" => $user->generateProfileLink($user->name, $user->surname), "twitter_link" => $user->generateProfileLink($user->name, $user->surname), "youtube_link" => $user->generateProfileLink($user->name, $user->surname), "skype_link" => $user->generateProfileLink($user->name, $user->surname), "created_at" => \Carbon\Carbon::now() ]); });