app/Http/Controllers/API/StudentController.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|string|min:6',
        ]);
        $user->update($request->all()) ;
        return ['message' => 'User Successfully Updated'] ;
    }
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|string|min:6' , ] ) ; $ user -> update ( $ request -> all ( ) ) ; return [ 'message' => 'User Successfully Updated' ] ; }
Update the specified resource in storage.
Update the specified resource in storage .