Example #1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     try {
         $list = Poll::findOrFail($id);
         $list->delete();
     } catch (Exception $e) {
         return redirect()->back()->withMessage('Error deleting Poll, Possibly it is already Deleted')->withStatus('error');
     }
     return redirect()->route('polls.index', compact('list'))->withMessage('Poll has been Deleted')->withStatus('success');
 }