app/Http/Controllers/OpdRegistrationController.php
/**
     * Display a listing of the resource.
     *
     * @param Request $request
     * @return void
     */
Display a listing of the resource.
@param Request $request
@return void
Display a listing of the resource . @param Request $request @return void
public function index(Request $request)
    {
        if ($request->ajax()) {
            $data = Registration::with('vital','consultation', 'medications.drugs', 'diagnosis.diagnoses')
                ->where('patient_id', $request->input('patient_id'))
                ->whereDate('created_at','!=',date('Y-m-d'))->get();
            echo json_encode($data);
        }
    }
public function index ( Request $ request ) { if ( $ request -> ajax ( ) ) { $ data = Registration :: with ( 'vital' , 'consultation' , 'medications.drugs' , 'diagnosis.diagnoses' ) -> where ( 'patient_id' , $ request -> input ( 'patient_id' ) ) -> whereDate ( 'created_at' , '!=' , date ( 'Y-m-d' ) ) -> get ( ) ; echo json_encode ( $ data ) ; } }
Display a listing of the resource.
Display a listing of the resource .