where('event_id', $record->id)->get(); $this->fumetto = []; $this->multiline = []; foreach ($res as $item) { $this->fumetto[] = $item; foreach ($multiline_client as $slot => $bookmaker) { if ($item->bookmaker_id == $bookmaker->bookmaker_id) { $this->multiline[$slot] = $item; } } } // $this->multiline = []; // foreach ($multiline_client as $slot => $bookmaker) { // $open = true; // foreach ($this->fumetto as $item) { // if ($item['bookmaker_id'] == $bookmaker->bookmaker_id) { // $this->multiline[$slot] = $item; // $open = false; // } // } // if ($open) { // $item = new stdClass; // $item['icon'] = $bookmaker->bookmaker->icon; // $item['h3w'] = 0; // $item['d3w'] = 0; // $item['a3w'] = 0; // $item['margin'] = 0; // $item['bookmaker_id'] = $bookmaker->bookmaker_id; // $this->multiline[$slot] = $item; // } // } } public function getMultilines(): ?array { return $this->multiline; } public function getFumetto() { return $this->fumetto; } }