public function update($id) { $laporan = Laporan::findOrFail($id); $laporan->fill(\Input::all()); if (\Input::get('status') == 4 || \Input::get('status') == 1) { $laporan->tarikhSiap = Carbon::now(); } if ($laporan->save()) { \Session::flash('success', 'Kemaskini Laporan berjaya'); } else { \Session::flash('fail', 'Kemaskini Laporan gagal'); } return Redirect::route(\Session::get('lastReport')); }
/** * Remove the specified resource from storage. * * @param int $id * @return Response */ public function destroy($id) { $laporan = Laporan::findOrFail($id); if ($laporan->delete()) { \Session::flash('success', 'Laporan berjaya dihapus'); } else { \Session::flash('error', 'Laporan gagal dihapus'); } return Redirect::route('members.user.laporan.index'); }
public function update2($id) { $laporan = Laporan::findOrFail($id); $laporan->fill(Request::all()); if (Request::get('status') == 4) { $laporan->tarikhSiap = Carbon::now(); } if ($laporan->save()) { \Session::flash('success', 'Laporan telah dikemaskini'); } else { \Session::flash('error', 'Laporan gagal dikemaskini'); } return Redirect::route('members.supervisor.laporan.terkini'); }