Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

monaabdo88's avatar

No query results for model App/Models/Country delete_all

I am working on project useing laravel and vuejs the problem is that I am trying to select multi rows and delete them the error is No query results for model [App\Models\Country] delete_all my route link

Route::delete('/delete_all','CountriesController@deleteAll');

delete function in the country controller

public function deleteAll(Request $request){ $ids = $request->ids; DB::table("countries")->whereIn('id',explode(",",$ids))->delete(); return response()->json('Selected Countries Deleted Successfully',200); } the delete method in the component

delAll(){ axios.delete('/dashboard/countries/delete_all', { ids: this.selected }).then(response => { toastr.success(response.data); }) } where can I find the Error

0 likes
3 replies
Snapey's avatar

How are you passing the array of IDs ?

Snapey's avatar

payload needs to be in a data object

delAll()
{ 
  axios
    .delete('/dashboard/countries/delete_all', { data: { ids: this.selected }})
    .then(response => { toastr.success(response.data); })
} 

Please or to participate in this conversation.