PHP Luminova: Request Origin Security and Hostname Configuration
Control which hostnames and request origins are allowed to access your application to block untrusted traffic.
The Security Configuration class provides properties to configure security-related settings in your application, such as trusted origins and hostnames, which will be used in the Request class for authenticating incoming request origins and hostname.
- Class namespace:
\App\Config\Security - File path:
/app/Config/Security.php - This class is marked as final and can't be subclassed
Properties
trustedOrigins
Set the list of trusted origin domains or patterns.
public array<int,string> $trustedOrigins = [];This will be use in
Requestclass for authenticating incoming requests origin.If none is specified then not additional check will be done when you call method
request()->getOrigin()orrequest()->isTrustedOrigin().
trustedHostname
Set the list of trusted hostname or patterns.
public array<int,string> $trustedHostname = [];This will be use in
Requestclass for authenticating your hostname.If none is specified then not additional check will be done when you call method
request()->getHostname().