app/Http/Controllers/UserController.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)
    {
        $user =User::find($id);
        $user->name=$request->name;
        $user->email=$request->email;
        if($request->password){
            $user->password=$request->password;
        }
        $user->save();
        return redirect()->back()->with(['success' => 'User details updated successfully.']);
    }
public function update ( Request $ request , $ id ) { $ user = User :: find ( $ id ) ; $ user -> name = $ request -> name ; $ user -> email = $ request -> email ; if ( $ request -> password ) { $ user -> password = $ request -> password ; } $ user -> save ( ) ; return redirect ( ) -> back ( ) -> with ( [ 'success' => 'User details updated successfully.' ] ) ; }
Update the specified resource in storage.
Update the specified resource in storage .