title: Check succes on laravel orm delete
body: <p>I have this table with a link to delete</p>
  
  <pre><code>@foreach ($tasks as $task)
          &lt;tr&gt;
            &lt;td&gt;{{$task-&gt;id}}&lt;/td&gt;
              &lt;td&gt;{{$task-&gt;name}}&lt;/td&gt;
              &lt;td&gt;&lt;a href="javascript:void(0)" onclick="eliminar({{$task-&gt;id}})" id="borrar_{{$task-&gt;id}}" name="borrar_{{$task-&gt;id}}" class="btn btn-danger"&gt;Eliminar&lt;/a&gt;&lt;/td&gt;
          &lt;/tr&gt;
      @endforeach
  </code></pre>
  
  <p>and the javascript code,which made a petition to the destroy method of the controller</p>
  
  <pre><code>function eliminar(id){
    var _token = $('meta[name="_token"]').attr('content');
    $.ajax({
  
             type: "DELETE",
             url: "task/"+id,
             data: { _token : _token},
             success: function (data) {
                $("#borrar_"+id).closest('tr').fadeOut();
             },
             error: function (data) {
                 alert('No se pudo eliminar el resgistro');
             }
      });
  }
  </code></pre>
  
  <p>the controller</p>
  
  <pre><code>&lt;?php
  
  namespace App\Http\Controllers;
  
  use Illuminate\Http\Request;
  
  use App\Http\Requests;
  use App\Task;
  
  class TaskController extends Controller
  {
     .
     .
     .
  
  /**
   * Remove the specified resource from storage.
   *
   * @param  int  $id
   * @return \Illuminate\Http\Response
   */
  public function destroy($id)
  {
       Task::destroy($id);
  }
  }
  </code></pre>
  
  <p>when the button is clicked his parent table row fades out ,but I think it's not the best way to do it. How I can check if the <code>Task::destroy($id)</code> was made succesfully or not to send a succes o error response to the ajax request</p>