App\Http\Controllers\AccountController::redirectLegacy PHP Method

redirectLegacy() public method

public redirectLegacy ( $section, boolean $subSection = false ) : Illuminate\Http\RedirectResponse
$section
$subSection boolean
return Illuminate\Http\RedirectResponse
    public function redirectLegacy($section, $subSection = false)
    {
        if ($section === 'details') {
            $section = ACCOUNT_COMPANY_DETAILS;
        } elseif ($section === 'payments') {
            $section = ACCOUNT_PAYMENTS;
        } elseif ($section === 'advanced_settings') {
            $section = $subSection;
            if ($section === 'token_management') {
                $section = ACCOUNT_API_TOKENS;
            }
        }
        if (!in_array($section, array_merge(Account::$basicSettings, Account::$advancedSettings))) {
            $section = ACCOUNT_COMPANY_DETAILS;
        }
        return Redirect::to("/settings/{$section}/", 301);
    }