body(); $data = json_decode(json_encode(simplexml_load_string($response)), true); $articles = $data["channel"]["item"]; $articlesitems = []; //Looping through the articles and scraping and while scraping it creates a new instance of the scraper. foreach ($articles as $article) { //Remove query strings $articlesitems[] = (new ThiladhunScraper)->extract(Str::before($article["link"], '?'), $article["pubDate"]); } return $articlesitems; } }