Delete routine [skip ci]

This commit is contained in:
James Cole
2014-07-23 08:16:04 +02:00
parent cc71a1116a
commit 1a9c44f7f9
5 changed files with 70 additions and 6 deletions

View File

@@ -46,4 +46,30 @@ class LimitController extends BaseController
}
}
public function delete($limitId)
{
$limit = $this->_limits->find($limitId);
if ($limit) {
return View::make('limits.delete')->with('limit', $limit);
} else {
return View::make('error')->with('message', 'No such limit!');
}
}
public function destroy($limitId)
{
$limit = $this->_limits->find($limitId);
if ($limit) {
$limit->delete();
return Redirect::route('budgets.index');
} else {
return View::make('error')->with('message', 'No such limit!');
}
}
}