I am trying to make a DELETE Request to my Laravel API.
I have a todo-App and a tasks.js with a removeTask Method that gets the task object passed as an argument.
removeTask: function(task)
{
this.tasks.$remove(task);
this.$http.delete('/api/tasks', { task, 'method': 'DELETE' });
},
Here is what I get in my chrome-dev-tools:
And this is the destroy Method on my TasksController:
public function destroy(Request $request, $id)
{
//
return response()->json(Input::all());
}
Where exactly am I going wrong here?
Thank you in advance.
EDIT
I have a resourceful route looking like this:
Route::get('/', function () {
return view('pages.tasks.index');
});
Route::group(['prefix' => 'api'], function() {
Route::resource('tasks', 'TasksController');
});
