I have task delete button in My laravel application,
this is My blade file delete button
<a href="/projects/{{ $project->id }}/tasks/{{ $task->id }}/delete" class="editInline"><i class="glyphicon glyphicon-trash"></i></a>
this is TaskController delete function
public function deleteOneProjectTask($projectId, $taskId)
{
DB::table('tasks')
->where('project_id', $projectId)
->where('id', $taskId)
->delete();
return redirect()->route('projects.show')->with('info', 'Task deleted successfully');
}
and this is route
Route::delete('projects/{projects}/tasks/{tasks}/delete', [
'uses' => '\App\Http\Controllers\TasksController@deleteOneProjectTask',
]);
but when I go to delete following error is coming,
MethodNotAllowedHttpException in RouteCollection.php line 218:
how can fix this problem?