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)
    {
        $id = Auth::user()->id;
        $user = User::where('id',$id )->update([
            'fullname' => $request->fullname==""?Auth::user()->fullname:$request->fullname  ,
            'dob' => $request->dob==""?Auth::user()->dob:$request->dob  ,
            'sex' => $request->sex==""?Auth::user()->sex:$request->sex  ,
        ]);
        return response()->json($user);
    }
public function update ( Request $ request , $ id ) { $ id = Auth :: user ( ) -> id ; $ user = User :: where ( 'id' , $ id ) -> update ( [ 'fullname' => $ request -> fullname == " " ? Auth :: user ( ) -> fullname : $ request -> fullname , 'dob' => $ request -> dob == " " ? Auth :: user ( ) -> dob : $ request -> dob , 'sex' => $ request -> sex == " " ? Auth :: user ( ) -> sex : $ request -> sex , ] ) ; return response ( ) -> json ( $ user ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
//