app/Http/Controllers/API/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::findOrFail($id);
        $this->validate($request,[
            'name'=>"required|string|max:191",
            'email'=>"required|string|email|max:191|unique:users,email,".$user->id,
            'password'=>"sometimes|min:6",
        ]);
        $user->update($request->all());
    }
public function update ( Request $ request , $ id ) { $ user = User :: findOrFail ( $ id ) ; $ this -> validate ( $ request , [ 'name' => " required|string|max:191 " , 'email' => " required|string|email|max:191|unique:users,email, " . $ user -> id , 'password' => " sometimes|min:6 " , ] ) ; $ user -> update ( $ request -> all ( ) ) ; }
Update the specified resource in storage.
Update the specified resource in storage .