Ejemplo n.º 1
0
 /**
  * Remove the specified resource from storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function destroy($id)
 {
     try {
         $agentCat = AgentCategory::findOrFail($id);
         $agentCat->delete();
         // Update all Agent tables too
         $execMsg = "Delete Successful!";
     } catch (ModelNotFoundException $e) {
         $execMsg = "Cannot delete record. Data not found.";
         return redirect('masterdata/agent-cat')->with('errMsg', $execMsg);
     }
     return redirect('masterdata/agent-cat')->with('message', $execMsg);
 }