app/Http/Controllers/UsersManagementController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, $id)
    {
        $validator = $this->edit_validator($request->all());
        if ($validator->fails()) {
            $this->throwValidationException(
                $request, $validator
                );
        } else {
            $user 				        = User::find($id);
            $user->name                 = $request->input('name');
            $user->empresa              = $request->input('empresa');
            $user->first_name           = $request->input('first_name');
            $user->last_name            = $request->input('last_name');
            $user->email                = $request->input('email');
            $user->role_id = $request->input('user_level');
            $user->save();
            return redirect('users/' . $user->id . '/')->with('status', 'Usuario actualizado éxitosamente!');
        }
    }
public function update ( Request $ request , $ id ) { $ validator = $ this -> edit_validator ( $ request -> all ( ) ) ; if ( $ validator -> fails ( ) ) { $ this -> throwValidationException ( $ request , $ validator ) ; } else { $ user = User :: find ( $ id ) ; $ user -> name = $ request -> input ( 'name' ) ; $ user -> empresa = $ request -> input ( 'empresa' ) ; $ user -> first_name = $ request -> input ( 'first_name' ) ; $ user -> last_name = $ request -> input ( 'last_name' ) ; $ user -> email = $ request -> input ( 'email' ) ; $ user -> role_id = $ request -> input ( 'user_level' ) ; $ user -> save ( ) ; return redirect ( 'users/' . $ user -> id . '/' ) -> with ( 'status' , 'Usuario actualizado éxitosamente!') ; } }
Update the specified resource in storage.
Update the specified resource in storage .
// SAVE USER CORE SETTINGS