app/controllers/UserController.php
/**
	 * Update the specified resource in storage.
	 *
	 * @return Response
	 */
Update the specified resource in storage.
@return Response
Update the specified resource in storage . @return Response
public function update()
	{
        $email = Input::get('a');
        $fname = Input::get('b');
        $lname = Input::get('c');
        $address1 = Input::get('d');
        $address2 = Input::get('e');
        $aptsuite = Input::get('f');
        $city = Input::get('g');
        $state = Input::get('h');
        $country = Input::get('i');
        $zip = Input::get('j');
        try
        {
            $user = User::find(Auth::user()->id);
            $user->email = $email;
            $user->first_name = $fname;
            $user->last_name = $lname;
            $user->address1 = $address1;
            $user->address2 = $address2;
            $user->apt_suite = $aptsuite;
            $user->city = $city;
            $user->state = $state;
            $user->country = $country;
            $user->zip = $zip;
            $user->save();
        }catch(Exception $e)
        {
            $error = new Error();
            $error->message = 'User: ' . Auth::user()->id . '  Message: ' . $e->getMessage();
            $error->line = $e->getLine();
            $error->file = 'UserController.php';
            $error->time = time();
            $error->save();
            return [0, 'User Profile failed to updated because: ' . $e->getMessage() . ' at line ' . $e->getLine()];
        }
        return [1, 'Profile updated successfully!'];
	}
public function update ( ) { $ email = Input :: get ( 'a' ) ; $ fname = Input :: get ( 'b' ) ; $ lname = Input :: get ( 'c' ) ; $ address1 = Input :: get ( 'd' ) ; $ address2 = Input :: get ( 'e' ) ; $ aptsuite = Input :: get ( 'f' ) ; $ city = Input :: get ( 'g' ) ; $ state = Input :: get ( 'h' ) ; $ country = Input :: get ( 'i' ) ; $ zip = Input :: get ( 'j' ) ; try { $ user = User :: find ( Auth :: user ( ) -> id ) ; $ user -> email = $ email ; $ user -> first_name = $ fname ; $ user -> last_name = $ lname ; $ user -> address1 = $ address1 ; $ user -> address2 = $ address2 ; $ user -> apt_suite = $ aptsuite ; $ user -> city = $ city ; $ user -> state = $ state ; $ user -> country = $ country ; $ user -> zip = $ zip ; $ user -> save ( ) ; } catch ( Exception $ e ) { $ error = new Error ( ) ; $ error -> message = 'User: ' . Auth :: user ( ) -> id . '  Message: ' . $ e -> getMessage ( ) ; $ error -> line = $ e -> getLine ( ) ; $ error -> file = 'UserController.php' ; $ error -> time = time ( ) ; $ error -> save ( ) ; return [ 0 , 'User Profile failed to updated because: ' . $ e -> getMessage ( ) . ' at line ' . $ e -> getLine ( ) ] ; } return [ 1 , 'Profile updated successfully!' ] ; }
Update the specified resource in storage.
Update the specified resource in storage .