client = new Client(); } /** * Get all the latest news * * @return array */ public function get() : array { $crawler = $this->client->request('GET', "https://hama.mv/"); $feeds = []; $crawler->filter('div[id*="latest"] div[class*="col-md-3 col-6"] a')->each(function ($node) use (&$feeds) { $feeds[] = [ "title" => $node->filter('h5')->first()->text(), "link" => $node->attr('href'), "date" => $node->filter('.datetime')->first()->text() ]; }); return $feeds; } }