Not sure I get what you're asking but a few tips:
$articles= Article::where('id', $articleIDs)->get(); //error here
//change to:
$articles= Article::whereIn('id', $articleIDs)->get();
... and if you only want id and slug:
$articles= Article::select('id', 'slug')->whereIn('id', $articleIDs)->get();
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community