public function getEdit($id = null) { $address = \App\Address::where('user_id', '=', \Auth::id())->get()->first(); if (is_null($address)) { \Session::flash('flash_message', 'Address not found'); return redirect('addresses/create'); } $stateModel = new \App\State(); $states_for_dropdown = $stateModel->getStatesForDropdown(); return view('address.edit')->with('address', $address)->with(['states_for_dropdown' => $states_for_dropdown]); }
public function getEdit($id = null) { $accounts = \App\Account::where('user_id', '=', \Auth::id())->find($id); if (is_null($accounts)) { \Session::flash('flash_message', 'Account not found'); return redirect('account/create'); } $stateModel = new \App\State(); $states_for_dropdown = $stateModel->getStatesForDropdown(); $acctTypes = ['Checking', 'Savings', 'Credit Card']; return view('account.edit')->with('accounts', $accounts)->with(['states_for_dropdown' => $states_for_dropdown])->with(['acctTypes' => $acctTypes]); }