/** * Api function for crawl post news to facebook fanpage. * * @return Response */ public function getPostToFBDaily() { // Get list fb ranges. $cCodes = json_decode(EXR_FB_RANGES); // Get list currency ids. $records = Currency::whereIn('code', $cCodes)->get(); if (count($records)) { // Get currency type $currencyIds = []; $goldIds = []; foreach ($records as $item) { if ($item->code == 'GOLD') { $goldIds[] = $item->id; } else { $currencyIds[] = $item->id; } } var_dump(Currency::getCurrenciesDetail($goldIds, 'GOLD')); var_dump(Currency::getCurrenciesDetail($currencyIds, 'CURRENCY')); die; } }