Delete components via link

This commit is contained in:
James Brooks
2014-12-13 13:50:21 +00:00
parent 582742f8fe
commit 51fedb8b82
3 changed files with 20 additions and 1 deletions
+18
View File
@@ -9,6 +9,10 @@ class DashboardController extends Controller {
return View::make('dashboard.index');
}
/**
* Creates a new incident.
* @return \Illuminate\Http\RedirectResponse
*/
public function createIncidentAction() {
$_incident = Input::get('incident');
$incident = Incident::create($_incident);
@@ -29,6 +33,10 @@ class DashboardController extends Controller {
]);
}
/**
* Creates a new component.
* @return \Illuminate\Http\RedirectResponse
*/
public function createComponentAction() {
$_component = Input::get('component');
$component = Component::create($_component);
@@ -36,6 +44,16 @@ class DashboardController extends Controller {
return Redirect::back()->with('component', $component);
}
/**
* Deletes a given component.
* @param Component $component
* @return \Illuminate\Http\RedirectResponse
*/
public function deleteComponentAction(Component $component) {
$component->delete();
return Redirect::back();
}
/**
* Shows the incidents view.
* @return \Illuminate\View\View