title: How do I call a function from Angular controller to Laravel Controller?
body: <p>First off, I'm pretty new with <strong>Laravel+Angular</strong> which basically why I'm here.</p>
  
  <p>I have this function delete from my Angular controller that uses <code>$http.delete()</code> to call the Laravel controller.</p>
  
  <pre><code>$scope.deleteJob = function(index) {
      $scope.loading = true;
  
      var job = $scope.jobs[index];
  
      $http.delete('/api/job/' + job.jobId)
          .success(function() {
              $scope.job.splice(index, 1);
              $scope.loading = false;
          });;
  };
  </code></pre>
  
  <p>With this route I should get to the Laravel controller:</p>
  
  <pre><code>Route::resource('api/job','ApiJobController');
  </code></pre>
  
  <p>Which i have defined a function to delete from my eloquent DB</p>
  
  <pre><code>public function destroy($id)
  {
      App\Job::destroy($id);
  }
  </code></pre>
  
  <p>I don't know what I miss but everytime I invoke <code>deleteJob(index)</code> I get a Server Error.</p>
  
  <pre><code>DELETE http://localhost:8000/api/job/20 500 (Internal Server Error)
  </code></pre>
  
  <p>I tried using <code>/api/job/destroy/</code>, still getting 500</p>