public function saveProfile() { $id = Auth::user()->id; $profile = UserProfile::firstOrNew(array('id' => $id)); $profile->fname = Input::get('fname'); $profile->lname = Input::get('lname'); $profile->streetno = Input::get('streetno'); $profile->street = Input::get('street'); $profile->suburb = Input::get('suburb'); $profile->postcode = Input::get('postcode'); $profile->state = Input::get('state'); $profile->dob = Input::get('dob'); $profile->phone = Input::get('phone'); $profile->tfn = Input::get('tfn'); $profile->pidtype = Input::get('pidtype'); $profile->pidnum = Input::get('pidnum'); $profile->sidtype = Input::get('sidtype'); $profile->sidnum = Input::get('sidnum'); $profile->description = Input::get('description'); $profile->gender = Input::get('gender'); $profile->occupation = Input::get('occupation'); $profile->save(); return Redirect::to('profile'); }
public function verify_email($code) { try { $user = User::where('activation_code', '=', $code)->first(); if ($user == null) { echo "Invalide verfication code"; return; } elseif ($user->activated == 1) { echo "You have already been verified"; return; } $user->activated = 1; $user->save(); $id = $user->id; Auth::login($user); //verify success and login user //create a profile record for this new user $profile = UserProfile::firstOrNew(array('id' => $id)); $financial = FinancialProfile::firstOrNew(array('user_id' => $id)); $profile->save(); $financial->save(); /*DB::table('users') -> where('activation_code',$code) -> update(array('activated'=>1)); }catch(Exception $e) { echo $e -> getMessage(); }*/ } catch (Exception $e) { echo $e->getMessage(); } return Redirect::route('myprofile'); }
public function saveNewProfile() { $id = Auth::user()->id; $profile = UserProfile::firstOrNew(array('id' => $id)); $profile->fname = Input::get('fname'); $profile->lname = Input::get('lname'); $profile->streetno = Input::get('streetno'); $profile->street = Input::get('street'); $profile->suburb = Input::get('suburb'); $profile->postcode = Input::get('postcode'); $profile->state = Input::get('state'); $profile->day_dob = Input::get('day_dob'); $profile->month_dob = Input::get('month_dob'); $profile->year_dob = Input::get('year_dob'); $profile->phone = Input::get('phone'); $profile->tfn = Input::get('tfn'); $profile->pidtype = Input::get('pidtype'); $profile->pidnum = Input::get('pidnum'); $profile->sidtype = Input::get('sidtype'); $profile->sidnum = Input::get('sidnum'); $profile->description = Input::get('description'); $profile->gender = Input::get('gender'); $profile->occupation = Input::get('occupation'); $profile->currency = 'AUD'; $profile->save(); $user = User::where('id', '=', $id)->first(); $user->profile_complete = 1; $user->save(); return Redirect::Route('profile'); }