/** * Remove the specified Element from storage. * * @param int $id * * @return Response */ public function destroy($id) { $element = $this->elementRepository->find($id); if (empty($element)) { Flash::error('Element not found'); return redirect(route('elements.index')); } $this->elementRepository->delete($id); Flash::success('Element deleted successfully.'); return redirect(route('elements.index')); }