public function signupUpdate(Request $request)
    {
        $this->middleware('auth:api');
        $data = $request->all();
        $validator = Validator::make($data, [
            'firstname'      => 'sometimes|required|max:255',
            'surname'        => 'sometimes|required|max:255',
            'email'          => 'sometimes|required|email|max:255|unique:users',
            'mobile_number'  => 'sometimes|min:10|unique:signup_data',
            'password'       => 'sometimes|required|min:6',
            'gender'         => 'sometimes|required',
            'user_id'        => 'required|integer',
        ]);

        if (!empty($validator->errors()->messages())) {
            return new Response([
                'status'  => 'FAIL',
                'message' => 'Fail to update user signup data',
                'Errors'  =>  $validator->errors()
            ], 500);
        } else {
            try {
                unset($data['_method']);
                $signupModel = Signup::find($data['user_id']);
                foreach ($data as $k => $ln) {
                    $signupModel->$k = $ln;
                }
                $signupModel->save();
                return new Response([
                    'status' => 'OK',
                    'message' => 'User signup data updated',
                ], 201);
            } catch (\Illuminate\Database\QueryException $ex) {
                return new Response([
                    'status'  => 'Fail',
                    'message' => 'Fail updating',
                    'Errors ' =>  $ex->getMessage()
                ]);

            }
        }
    }
public function signupUpdate(Request $request)
    {
        $this->middleware('auth:api');
        $data = $request->all();
        $validator = Validator::make($data, [
            'firstname'      => 'sometimes|required|max:255',
            'surname'        => 'sometimes|required|max:255',
            'email'          => 'sometimes|required|email|max:255|unique:users',
            'mobile_number'  => 'sometimes|min:10|unique:signup_data',
            'password'       => 'sometimes|required|min:6',
            'gender'         => 'sometimes|required',
            'user_id'        => 'required|integer',
        ]);

        if (!empty($validator->errors()->messages())) {
            return new Response([
                'status'  => 'FAIL',
                'message' => 'Fail to update user signup data',
                'Errors'  =>  $validator->errors()
            ], 500);
        } else {
            try {
                unset($data['_method']);
                $signupModel = Signup::find($data['user_id']);
                foreach ($data as $k => $ln) {
                    $signupModel->$k = $ln;
                }
                $signupModel->save();
                return new Response([
                    'status' => 'OK',
                    'message' => 'User signup data updated',
                ], 201);
            } catch (\Illuminate\Database\QueryException $ex) {
                return new Response([
                    'status'  => 'Fail',
                    'message' => 'Fail updating',
                    'Errors ' =>  $ex->getMessage()
                ]);

            }
        }
    }
public function signupUpdate ( Request $ request ) { $ this -> middleware ( 'auth:api' ) ; $ data = $ request -> all ( ) ; $ validator = Validator :: make ( $ data , [ 'firstname' => 'sometimes|required|max:255' , 'surname' => 'sometimes|required|max:255' , 'email' => 'sometimes|required|email|max:255|unique:users' , 'mobile_number' => 'sometimes|min:10|unique:signup_data' , 'password' => 'sometimes|required|min:6' , 'gender' => 'sometimes|required' , 'user_id' => 'required|integer' , ] ) ; if ( ! empty ( $ validator -> errors ( ) -> messages ( ) ) ) { return new Response ( [ 'status' => 'FAIL' , 'message' => 'Fail to update user signup data' , 'Errors' => $ validator -> errors ( ) ] , 500 ) ; } else { try { unset ( $ data [ '_method' ] ) ; $ signupModel = Signup :: find ( $ data [ 'user_id' ] ) ; foreach ( $ data as $ k => $ ln ) { $ signupModel -> $ k = $ ln ; } $ signupModel -> save ( ) ; return new Response ( [ 'status' => 'OK' , 'message' => 'User signup data updated' , ] , 201 ) ; } catch ( \ Illuminate \ Database \ QueryException $ ex ) { return new Response ( [ 'status' => 'Fail' , 'message' => 'Fail updating' , 'Errors ' => $ ex -> getMessage ( ) ] ) ; } } }
Update user signup instance.

@param Request $request
@return Signup
Update user signup instance .