/** * Run the database seeds. * * @return void */ public function run() { Model::unguard(); $faker = Faker\Factory::create(); for ($i = 0; $i < 100; $i++) { $user = User::create(array('name' => $faker->name, 'email' => $faker->email, 'password' => bcrypt($faker->password(10, 12)), 'mobile_no' => '' . $faker->numberBetween(1234567890, 2134567890), 'user_type' => 'normal')); } }
/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ public function create(array $data) { return User::create(['name' => $data['name'], 'email' => $data['email'], 'mobile_no' => $data['mobile_no'], 'user_type' => $data['user_type'], 'password' => bcrypt($data['password'])]); }