/** * Update the specified kin in storage. * * @param int $id * @return Response */ public function update($id) { $kin = Kin::findOrFail($id); $validator = Validator::make($data = Input::all(), Kin::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $member = Member::findOrFail(Input::get('member_id')); $kin->member()->associate($member); $kin->name = Input::get('name'); $kin->rship = Input::get('rship'); $kin->goodwill = Input::get('goodwill'); $kin->id_number = Input::get('id_number'); $kin->update(); return Redirect::to('members/show/' . $member->id); }
/* * orders controllers */ Route::resource('orders', 'OrdersController'); Route::post('orders/update/{id}', 'OrdersControler@update'); Route::get('orders/edit/{id}', 'OrdersControler@edit'); Route::get('orders/delete/{id}', 'OrdersControler@destroy'); Route::get('savings', function () { $mem = Confide::user()->username; $memb = DB::table('members')->where('membership_no', '=', $mem)->pluck('id'); $member = Member::find($memb); return View::make('css.savingaccounts', compact('member')); }); Route::post('loanguarantors', function () { $mem_id = Input::get('member_id'); $member = Member::findOrFail($mem_id); $loanaccount = Loanaccount::findOrFail(Input::get('loanaccount_id')); $guarantor = new Loanguarantor(); $guarantor->member()->associate($member); $guarantor->loanaccount()->associate($loanaccount); $guarantor->amount = Input::get('amount'); $guarantor->save(); return Redirect::to('memloans/' . $loanaccount->id); }); Route::get('backups', function () { //$backups = Backup::getRestorationFiles('../app/storage/backup/'); return View::make('backup'); }); Route::get('backups/create', function () { echo '<pre>'; $instance = Backup::getBackupEngineInstance();
public function testMember() { $member = Member::findOrFail(1); $this->assertTrue($member->FirstName == 'Todd'); }
public function memberaccounts($id) { $member = Member::findOrFail($id); return View::make('savingaccounts.memberaccounts', compact('member')); }
public function cssupdate($id) { $mem_id = Input::get('member_id'); $member = Member::findOrFail($mem_id); $loanaccount = Loanaccount::findOrFail(Input::get('loanaccount_id')); $guarantor = Loanguarantor::findOrFail($id); $validator = Validator::make($data = Input::all(), Loanguarantor::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $guarantor->member()->associate($member); $guarantor->loanaccount()->associate($loanaccount); $guarantor->amount = Input::get('amount'); $guarantor->save(); return Redirect::to('memloans/' . $loanaccount->id); }
public function reset($id) { //$id = DB::table('members')->where('membership_no', '=', $mem)->pluck('id'); $member = Member::findOrFail($id); $user_id = DB::table('users')->where('username', '=', $member->membership_no)->pluck('id'); $user = User::findOrFail($user_id); $user->password = Hash::make('tacsix123'); $user->update(); return Redirect::back(); }