public function update(ProfileRequest $request, User $user)
    {
        event(new ProfileWasUpdated($request));

        if ($request->wantsJson()) {
            return $this->respondsWithSuccess('ok');
        }

        return back();
    }
public function update(ProfileRequest $request, User $user)
    {
        event(new ProfileWasUpdated($request));

        if ($request->wantsJson()) {
            return $this->respondsWithSuccess('ok');
        }

        return back();
    }
public function update ( ProfileRequest $ request , User $ user ) { event ( new ProfileWasUpdated ( $ request ) ) ; if ( $ request -> wantsJson ( ) ) { return $ this -> respondsWithSuccess ( 'ok' ) ; } return back ( ) ; }
Updates the user profile.

@param  ProfileRequest $request
@param  User $user

@return void
Updates the user profile .