client = new Client(); } /** * Get all the latest news * * @return array */ public function get() : array { $crawler = $this->client->request('GET', "https://www.thiladhun.com"); $feeds = []; $crawler->filter('div[class*="posts-listing posts-list"] article')->each(function ($node) use (&$feeds) { $feeds[] = [ "title" => $node->filter('.post__title a')->text(), "link" => $node->filter('.post__title a')->attr('href'), "date" => $node->filter('time')->first()->attr('datetime') ]; }); return $feeds; } }