getItems(); foreach ($config as $key => $value) { $bool = self::doesIsShowAvailable($key); if ($bool) { return true; } } return false; } public static function doesIsShowAvailable($key) { $bool = false; switch ($key) { case 'merchant': if (\Setting::get('plugin.merchant.settlement_model')) { $bool = true; } break; case 'commission': if (\Setting::get('plugin.commission.settlement_model')) { $bool = true; } break; case 'areaDividend': if (\Setting::get('plugin.area_dividend.settlement_model')) { $bool = true; } break; case 'teamDividend': if (\Setting::get('plugin.team_dividend.settlement_model')) { $bool = true; } break; case 'weeklyRewards': $week = array_pluck(\Setting::getAllByGroup('weekly-rewards')->toArray(), 'value', 'key'); if ($week['dividend_settle'] || $week['area_settle']) { $bool = true; } break; default: $bool = false; } return $bool; } }