oddnames); $fields = explode(',', $value->fieldnames); $arr[$value->name] = array_combine($fields, $names); } return $arr; } public static function fields() { $res = OddsTable::get(); $arr = []; foreach ($res as $value) { $arr[$value->name] = explode(',', $value->oddnames); } return $arr; } public static function options_sport() { switch (auth()->user()->sport_id) { case 1: return OddsTable::where('soccer', 1)->pluck('fulltitle', 'id'); case 2: return OddsTable::where('icehockey', 1)->pluck('fulltitle', 'id'); case 3: return OddsTable::where('basketball', 1)->pluck('fulltitle', 'id'); case 5: return OddsTable::where('tennis', 1)->pluck('fulltitle', 'id'); } return []; } }