/** * Store a newly created loanguarantor in storage. * * @return Response */ public function store() { $validator = Validator::make($data = Input::all(), Loanguarantor::$rules); if ($validator->fails()) { return Redirect::back()->withErrors($validator)->withInput(); } $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('loans/show/' . $loanaccount->id); }
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(); print_r($instance); //Backup::setPath(public_path().'/backups/'); //Backup::export(); //$backups = Backup::getRestorationFiles('../app/storage/backup/');