I use Laravel as Backend and generate API by JSON and the i use php to get json data and delete data by route api in laravel but it's seem to be not working. My API Route in laravel
Route::delete('articles/{article}', 'ArticleController@delete');
My Controller
public function delete(Article $article)
{
$article->delete();
return response()->json(null);
}
My API URL
http://192.168.0.21/api/articles/id
My PHP frontend Code for delete
$json = file_get_contents('http://192.168.0.21/api/articles/' . $id);
$json_data = json_decode($json, true);
unset($json_data['id']);
Any solution for these?