public function update(Request $request, $id) { if (Auth::user()->role === 'superadmin') { $input = $request->all(); $data = Loan::findOrFail($id); $data->update($input); return redirect('loan'); } else { return redirect('auth/login'); } }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $loan = Loan::findOrFail($id)->delete(); return Redirect::route('admin.setup.loan.company.index')->withFlashSuccess('Company Loans data was successfully deleteds.'); }