2 months ago

how to save data from one form into different db tables

Posted 2 months ago by alphadev

hi m working on a form which has two different parts, and only one part works at a time and I have to comment one part to use the other: (m using resource routes for both)


    public function store(Request $request)
                'patient_name' => 'required',
                'patient_insurance' => 'required',
                'patient_insurance_id' => 'required',
                'patient_reason' => 'required',
                'patient_new' => 'required',
                'patient_contact_no' => 'required',
                'patient_message' => 'required',

                'patient_fname' => $request->patient_fname,
                'patient_lname' => $request->patient_lname,
                'patient_email' => $request->patient_email,
                'patient_dob' => $request->patient_dob,
                'patient_guardian' => $request->patient_guardian,
                'patient_gender' => $request->patient_gender, 
                'user_id' => $request->user_id,

                'patient_name' => $request->patient_name,
                'patient_insurance' => $request->patient_insurance,
                'patient_insurance_id' => $request->patient_insurance_id,
                'patient_reason' => $request->patient_reason,
                'patient_new' => $request->patient_new,
                'patient_contact_no' => $request->patient_contact_no,
                'patient_message' => $request->patient_message,

            return back();

this is form:

I need suggestion to solve it?

Please sign in or create an account to participate in this conversation.