/**
  * Remove the specified resource from storage.
  * @param type int $id
  * @param type Template $template
  * @return type Response
  */
 public function destroy($id, Template $template)
 {
     try {
         $templates = $template->whereId($id)->first();
         /* Check whether function success or not */
         if ($templates->delete() == true) {
             /* redirect to Index page with Success Message */
             return redirect('template')->with('success', 'Teams  Deleted Successfully');
         } else {
             /* redirect to Index page with Fails Message */
             return redirect('template')->with('fails', 'Teams  can not Delete');
         }
     } catch (Exception $e) {
         /* redirect to Index page with Fails Message */
         return redirect('template')->with('fails', 'Teams  can not Delete');
     }
 }