public function makeRedirect($context = null, $model = null)
    {
        $redirectUrl = null;
        if (post('close') && !ends_with($context, '-close')) {
            $context .= '-close';
        }

        if (post('refresh', false)) {
            return Redirect::refresh();
        }

        if (post('redirect', true)) {
            $redirectUrl = $this->getRedirectUrl($context);
        }

        if ($model && $redirectUrl) {
            $redirectUrl = RouterHelper::replaceParameters($model, $redirectUrl);
        }

        if (starts_with($redirectUrl, 'http://') || starts_with($redirectUrl, 'https://')) {
            // Process absolute redirects
            $redirect = Redirect::to($redirectUrl);
        } else {
            // Process relative redirects
            $redirect = $redirectUrl ? Backend::redirect($redirectUrl) : null;
        }

        return $redirect;
    }