Skip to content
Examples and API calls for Laravel

Portal and detours ​

Portal intercepts browser requests and sends them to the connected client for handling. Configure matching URLs per context through supports.portal.urlPrefixes. Requests that do not match a prefix continue normally.

Context options ​

OptionServer defaultBehavior
portaltrueEnables portal interception for the context. When disabled, no CDP Fetch interception is installed.
detourtrueAllows fallback through /portal/detour when a portal request body cannot be read directly, such as an oversized or multipart body.

Setting detour to false keeps normal portal handling enabled while preventing the fallback route.

Change settings after creation ​

Contexts expose these methods:

  • $context->enablePortal()
  • $context->disablePortal()
  • $context->enableDetour()
  • $context->disableDetour()

For example:

php
$context->enablePortal();
$context->disableDetour();

URL prefix matching still applies after portal is enabled.

Client defaults ​

The Laravel test case creates contexts with portal and detours disabled. Use $this->context to access its context. See Laravel portal setup for the enabling trait and option overrides.