/** * Run the database seeds. * * @return void */ public function run() { //DB::table('tbl_users')->delete(); User::create(array('usr_firstName' => 'Daigo', 'usr_lastName' => 'Fernandez', 'username' => 'dfernandez', 'email' => '*****@*****.**', 'password' => bcrypt('@Daigo@10#'))); User::create(array('usr_firstName' => 'Junior', 'usr_lastName' => 'Yauricasa', 'username' => 'jyauricasa', 'email' => '*****@*****.**', 'password' => bcrypt('@Junior@10#'))); User::create(array('usr_firstName' => 'Galia', 'usr_lastName' => 'Camayo', 'username' => 'gcamayo', 'email' => '*****@*****.**', 'password' => bcrypt('@Galia@10#'))); /* DB::table('articles')->truncate(); DB::table('articles')->insert([ [ 'title' => 'Laozi', 'body' => 'When there is no desire, all things are at peace.', 'created_at' => '2015-01-31 23:59:59', 'updated_at' => '2015-01-31 23:59:59', ], [ 'title' => 'Leonardo da Vinci', 'body' => 'Simplicity is the ultimate sophistication.', 'created_at' => '2015-02-01 00:00:00', 'updated_at' => '2015-02-01 00:00:00', ], [ 'title' => 'Cedric Bledsoe', 'body' => 'Simplicity is the essence of happiness.', 'created_at' => '2015-02-01 00:00:01', 'updated_at' => '2015-02-01 00:00:01', ], ]); */ }
/** * Run the database seeds. * * @return void */ public function run() { if ($this->command->confirm('Create admin account?')) { $name = $this->requiredValue('Name', 'Admin'); $email = $this->requiredEmail('Email'); $password = bcrypt($this->requiredValue('Password')); $user = User::create(compact('name', 'email', 'password')); $user->roles()->attach([UserRole::ADMIN, UserRole::MEMBER]); } }
/** * Create a new user. * * @param array $item * @return Model */ public function create(array $item) { $item['password'] = bcrypt(data_get($item, 'password')); return User::create($item); }
/** * Create a new user instance after a valid registration. * * @param array $data * @return \App\Data\Models\User */ protected function create(array $data) { return User::create(['name' => $data['name'], 'email' => $data['email'], 'password' => bcrypt($data['password'])]); }