TrustHosts
class TrustHosts (View source)
Properties
| protected Application | $app | The application instance. |
|
| static protected array<int, string>|callable(): array<int, string>|null | $alwaysTrust | The trusted hosts that have been configured to always be trusted. |
|
| static protected bool|null | $subdomains | Indicates whether subdomains of the application URL should be trusted. |
Methods
Get the host patterns that should be trusted.
Specify the hosts that should always be trusted.
Determine if the application should specify trusted hosts.
Get a regular expression matching the application URL and all of its subdomains.
Flush the state of the middleware.
Details
__construct(Application $app)
Create a new middleware instance.
array
hosts()
Get the host patterns that should be trusted.
static void
at(array|callable $hosts, bool $subdomains = true)
Specify the hosts that should always be trusted.
protected bool
shouldSpecifyTrustedHosts()
Determine if the application should specify trusted hosts.
protected string|null
allSubdomainsOfApplicationUrl()
Get a regular expression matching the application URL and all of its subdomains.
static void
flushState()
Flush the state of the middleware.
Laravel Cloud is the best place to deploy Laravel, Nuxt, Express, Hono, Node.js, Bun, Go, Flask, Python, and more, with dedicated infrastructure available on AWS through Laravel Private Cloud.