app/Http/Controllers/UserController.php
/**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request $request
     * @param  \App\User $user
     * @return \Illuminate\Http\Response
     */
Update the specified resource in storage.
Update the specified resource in storage .
public function update(Request $request, User $user)
    {
        try {
            $new_user = User::where('id', $request->id)->firstOrFail();
            $new_user->name = $request->name;
            $new_user->last_name = $request->last_name;
            $new_user->email = $request->email;
            $new_user->save();
            return redirect('user/edit/' . $new_user->id)
                ->with('status_box', 'success')
                ->with('status', trans('user.update_user'))
                ;
        } catch (\Exception $e) {
            return redirect('user/edit/' . $new_user->id)
                ->with('status_box', 'danger')
                ->with('status', 'user.error_update_user')
                ;
        }
    }
public function update ( Request $ request , User $ user ) { try { $ new_user = User :: where ( 'id' , $ request -> id ) -> firstOrFail ( ) ; $ new_user -> name = $ request -> name ; $ new_user -> last_name = $ request -> last_name ; $ new_user -> email = $ request -> email ; $ new_user -> save ( ) ; return redirect ( 'user/edit/' . $ new_user -> id ) -> with ( 'status_box' , 'success' ) -> with ( 'status' , trans ( 'user.update_user' ) ) ; } catch ( \ Exception $ e ) { return redirect ( 'user/edit/' . $ new_user -> id ) -> with ( 'status_box' , 'danger' ) -> with ( 'status' , 'user.error_update_user' ) ; } }
Update the specified resource in storage.
Update the specified resource in storage .