public function userstore(UserFormRequest $request) { //GET number of users requested $users = $request->input('users'); $profile = $request->input('profile'); $password = $request->input('password'); $address = $request->input('address'); $faker = Faker\Factory::create(); $password_generator = new Joypasswd(); //Initialize username array. For example purposes I will just use one array. //Username will store all the users that will be generated //The $users variable should be the number of users that need to be created for ($i = 0; $i < $users; $i++) { $usercred = "Username: "******"Password: "******"Address: " . $faker->address; $usercred .= '%'; } if (isset($profile)) { $usercred .= "Profile: " . $faker->text; } //loop and store each username into the username array //$username = array($faker->name, $faker->address, $password_generator->passwdgen()); // $userprofile[] = $faker->text; //// $useraddress[] = $faker->address; //$userpassword[] = $password_generator->passwdgen(); $username[] = $usercred; } return view('store.userstore', ['username' => $username, 'usercred' => $usercred]); }
public function userstore(UserFormRequest $request) { //return \Redirect::route('contact'); $users = $request->input('users'); return view('store.userstore')->with('users', $users); }