public function saveLendPref() { $id = Auth::user()->id; $loanApp = LoanApp::where('user_id', '=', $id)->get(); $profile = UserProfile::where('id', '=', $id)->first(); $financial = FinancialProfile::where('user_id', $id)->first(); $lender_prefers = LenderPref::firstOrNew(array('user_id' => $id)); $lender_prefers->min_amount = Input::get('minLoan'); $lender_prefers->min_term = Input::get('minTerm'); $lender_prefers->min_rate = Input::get('minRate'); $lender_prefers->max_amount = Input::get('maxLoan'); $lender_prefers->max_term = Input::get('maxTerm'); $lender_prefers->max_rate = Input::get('maxRate'); $lender_prefers->save(); $results = $this->search(); $pdata = $profile->getProfile($id); // method defined in its model $fdata = $financial->getFinancialProfile($id); // methd defined in its model $bids = DB::table('bids')->join('loan_app', 'bids.loan_id', '=', 'loan_app.loan_id')->join('profile', 'profile.id', '=', 'loan_app.user_id')->select('bid_amount', 'pref_rate', 'term', 'purpose', 'fname', 'lname')->orderBy('bid_date', 'DESC')->get(); return View::make('myprofiles', compact('bids', 'pdata', 'fdata', 'results', 'loanApp')); /* return Redirect::route('myprofile'); */ }