app/Http/Controllers/PatientController.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)
    {
        $this->validateWith([
            'patient_name' => 'required',
            'gender' => 'required'
        ]);
        $pat = Patient::findOrFail($id);
        $pat->patient_name = $request->patient_name;
        $pat->patient_age = $request->patient_age;
        $pat->year_or_month = $request->year_or_month;
        $pat->dob = $request->dob;
        $pat->gender = $request->gender;
        $pat->phone = $request->phone;
        $pat->email = $request->email;
        $pat->province = $request->province;
        $pat->district = $request->district;
        $pat->municipality = $request->municipality;
        $pat->ward = $request->ward;
        $pat->symptoms = $request->symptoms;
        $pat->symptoms_if_any = $request->symptoms_if_any;
        $pat->refering_physician = $request->refering_physician;
        $pat->specimen = $request->specimen;
        $pat->specimen_coll_site = $request->specimen_coll_site;
        $pat->specimen_coll_date = $request->specimen_coll_date;
        $pat->specimen_coll_time = $request->specimen_coll_time;
        $pat->reporting_date = $request->reporting_date;
        $pat->reporting_time = $request->reporting_time;
        $pat->morbidity = $request->morbidity;
        $pat->passport = $request->passport;
        $pat->reference = $request->reference;
        $pat->remark = $request->remark;
        $pat->save();
        Session::flash('success', 'Succesfully Updated Patient Information.');
        return redirect()->back();
    }
public function update ( Request $ request , $ id ) { $ this -> validateWith ( [ 'patient_name' => 'required' , 'gender' => 'required' ] ) ; $ pat = Patient :: findOrFail ( $ id ) ; $ pat -> patient_name = $ request -> patient_name ; $ pat -> patient_age = $ request -> patient_age ; $ pat -> year_or_month = $ request -> year_or_month ; $ pat -> dob = $ request -> dob ; $ pat -> gender = $ request -> gender ; $ pat -> phone = $ request -> phone ; $ pat -> email = $ request -> email ; $ pat -> province = $ request -> province ; $ pat -> district = $ request -> district ; $ pat -> municipality = $ request -> municipality ; $ pat -> ward = $ request -> ward ; $ pat -> symptoms = $ request -> symptoms ; $ pat -> symptoms_if_any = $ request -> symptoms_if_any ; $ pat -> refering_physician = $ request -> refering_physician ; $ pat -> specimen = $ request -> specimen ; $ pat -> specimen_coll_site = $ request -> specimen_coll_site ; $ pat -> specimen_coll_date = $ request -> specimen_coll_date ; $ pat -> specimen_coll_time = $ request -> specimen_coll_time ; $ pat -> reporting_date = $ request -> reporting_date ; $ pat -> reporting_time = $ request -> reporting_time ; $ pat -> morbidity = $ request -> morbidity ; $ pat -> passport = $ request -> passport ; $ pat -> reference = $ request -> reference ; $ pat -> remark = $ request -> remark ; $ pat -> save ( ) ; Session :: flash ( 'success' , 'Succesfully Updated Patient Information.' ) ; return redirect ( ) -> back ( ) ; }
Update the specified resource in storage.
Update the specified resource in storage .
// $pat->lab_id = $request->lab_id;