Deleting of incidents
This commit is contained in:
@@ -8,7 +8,7 @@ class DashIncidentController extends Controller
|
||||
*/
|
||||
public function showIncidents()
|
||||
{
|
||||
$incidents = Incident::all();
|
||||
$incidents = Incident::orderBy('created_at', 'desc')->get();
|
||||
|
||||
return View::make('dashboard.incidents')->with([
|
||||
'pageTitle' => 'Incidents - Dashboard',
|
||||
@@ -61,4 +61,16 @@ class DashIncidentController extends Controller
|
||||
|
||||
return Redirect::back()->with('incident', $incident);
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a given incident.
|
||||
* @param Incident $incident
|
||||
* @return \Illuminate\Http\RedirectResponse
|
||||
*/
|
||||
public function deleteIncidentAction(Incident $incident)
|
||||
{
|
||||
$incident->delete();
|
||||
|
||||
return Redirect::back();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user