/** * Removes a record from the database table * * @param integer $id Corresponds to the id-column * @return RedirectResponse Redirects */ public function delete($id) { if (!$id || $id <= 0) { return redirect(url('/references/index')); } $ref = Reference::find($id); $ref->notes()->detach(); $ref->outlines()->detach(); $ref->delete(); return redirect('/references/index'); }