app/Http/Controllers/ProfileController.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(UserConfigurationRequest $request,$id)
    {
        $users = Users::findOrFail($id);
        if(!empty($request->password)){
            $users->password = bcrypt($request->password);
        }
		$users->username = $request->username;
		$users->full_name = $request->fullname;
		$users->nick_name = $request->nickname;
		$users->email = $request->email;
		$users->birthdate = !empty($request->birthdate)? $request->birthdate : null;
        $validated = $request->validated();
        $users->save();
        return response()->json(['data'=>['users_id'=>$users->id]]) ;
    }
public function update ( UserConfigurationRequest $ request , $ id ) { $ users = Users :: findOrFail ( $ id ) ; if ( ! empty ( $ request -> password ) ) { $ users -> password = bcrypt ( $ request -> password ) ; } $ users -> username = $ request -> username ; $ users -> full_name = $ request -> fullname ; $ users -> nick_name = $ request -> nickname ; $ users -> email = $ request -> email ; $ users -> birthdate = ! empty ( $ request -> birthdate ) ? $ request -> birthdate : null ; $ validated = $ request -> validated ( ) ; $ users -> save ( ) ; return response ( ) -> json ( [ 'data' => [ 'users_id' => $ users -> id ] ] ) ; }
Update the specified resource in storage.
Update the specified resource in storage .