/** * Create a new user instance after a valid registration. * * @param array $data * @return User */ protected function create(array $data) { $user = User::create(['first_name' => $data['first_name'], 'last_name' => $data['last_name'], 'email' => $data['email'], 'dob' => $data['dob'], 'gender' => $data['gender'], 'password' => bcrypt($data['password'])]); $name = $data['first_name']; $email = $data['email']; $user_id = $user->id; Calendar::create(array('name' => $name, 'color' => '51, 153, 255', 'user_id' => $user_id)); Todolist::create(array('name' => 'To Do', 'color' => '0, 0, 102', 'user_id' => $user_id)); Style::create(array('theme_name' => 'default', 'body_backgroundColor' => '218, 173, 134', 'buttons_backgroundColor' => '117, 168, 202', 'buttons_borderColor' => '89, 105, 114', 'navBar_backgroundColor' => '201, 216, 197', 'menuModal_backgroundColor' => '255, 246, 253', 'user_id' => $user_id)); $emaildata = array('name' => $name); Mail::send('emails.welcome', $emaildata, function ($message) use($email) { $message->from('*****@*****.**', 'gmPlanner'); $message->to($email)->subject('Welcome to gmPlanner'); }); return $user; }
/** * Run the database seeds. * * @return void */ public function run() { Style::create(array('theme_name' => 'default', 'body_backgroundColor' => '218, 173, 134', 'buttons_backgroundColor' => '117, 168, 202', 'buttons_borderColor' => '89, 105, 114', 'navBar_backgroundColor' => '201, 216, 197', 'menuModal_backgroundColor' => '255, 246, 253', 'user_id' => 1)); }
protected function createStyles(array $styles) { foreach ($styles as $s) { Style::create(['name' => $s]); } }