public function crawler(Request $request) { $pdfs = Pdf::all(); // $pricelists = Pdf::all(); $result = "<div class='crawler_list'><div class='row'>"; $result = $result . "<h4>PDF</h4><ul class='list-crawler'>"; foreach ($pdfs as $pdf) { $result = $result . "<li>"; $retailers = \DB::table('retailers')->where('id', '=', $pdf->retailer_id)->get(); foreach ($retailers as $retailer) { $result = $result . $retailer->retailer_name; } $result = $result . $pdf->crawler->id; $result = $result . "</li>"; } $result = $result . "</ul></div><div class='row'>"; $websites = Website::all(); // $pricelists = Pdf::all(); $result = $result . "<button type='button' class='btn btn-xs' id='progress'>Progress</button>" . "<h4>WEBSITE</h4>"; foreach ($websites as $website) { // $retailers = \DB::table('retailers')->where('id', '=', $pdf->pricelist->retailer_id )->get(); // foreach ($retailers as $retailer) { // $result = $result. $retailer->retailer_name; // } $result = $result . $website->crawler->id; } $result = $result . "</div></div>"; return $result; // foreach ($pricelists as $pricelist) { // // } }