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;
    }
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;
    }
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 ; }
Returns a Redirect object based on supplied context and parses
the model primary key.

@param string $context Redirect context, eg: create, update, delete
@param Model $model The active model to parse in it's ID and attributes.
@return Redirect
Returns a Redirect object based on supplied context and parses the model primary key .