Security
The core Laravel security toolkit in the ArtisanPack UI ecosystem: input sanitization, output escaping, KSES filtering, security headers, XSS protection, rate limiting and a full Content Security Policy suite.
v2.2.0
MIT License
★ 1
composer require artisanpack-ui/security
$ composer require artisanpack-ui/security
✓ Installed
$ php artisan vendor:publish --tag=security-config
✓ Published config/security.php
echo Security::escHtml($userContent);
What it does
The security core everything else builds on
Sanitize, escape, filter and lock down HTTP \u2014 the foundational hardening layer. Auth, RBAC, uploads, analytics and compliance now live in dedicated sibling packages.
Sanitization
sanitizeEmail, sanitizeUrl, sanitizeText, sanitizeInt, sanitizeArray and more.
Escaping
escHtml, escAttr, escUrl, escJs and escCss, backed by Laminas Escaper.
KSES filtering
WordPress-style kses() allowed-tag filtering, plus NoHtml and SecureUrl rules.
Headers middleware
csp, security.headers, xss.protection, api.security and api.rate_limit.
Content Security Policy
Nonce generator, policy builder, presets, violation reporting and a CSP dashboard.
Security audit tools
security:audit, scan, baseline and benchmark, plus an OWASP testing suite.
Get started
Install and publish config
Use the Security facade or the global helpers, then group your routes behind the csp and security.headers middleware.
1 · Install
composer require artisanpack-ui/security
2 · Publish the config
php artisan vendor:publish --tag=security-config
Requirements
What you need
| Requirement | Detail |
|---|---|
| PHP | 8.2+ (8.3+ on Laravel 13) |
| Laravel | 10, 11, 12 or 13 |
| CSP dashboard | livewire/livewire (optional) |
| Security 2.0 is core-only — auth, RBAC, uploads, analytics and compliance moved to dedicated sibling packages. See security-full for the whole suite. | |
Updates
Latest Updates
The security suite
Other packages under the umbrella
Security 2.0 split the auth, RBAC, uploads, analytics and compliance features into dedicated packages. Add just what you need — or grab the whole suite with Security Full.
v1.0.1
Security Auth
2FA (email + TOTP), password complexity, account lockout and sessions.
View package
v1.0.1
Security Advanced Auth
WebAuthn / passkeys, SSO, social login, biometrics and device fingerprinting.
View package
v1.0.1
Secure Uploads
File validation, malware scanning, signed-URL storage and quarantine.
View package
v1.2.0
Security Analytics
Event logging, anomaly detection, SIEM export and incident response.
View package
v1.1.0
Compliance
GDPR, CCPA and LGPD consent, data subject rights, DPIA and reporting.
View package
Meta
Security Full
One require that bundles the entire security suite at coordinated versions.
View package
Harden your app with Security
Sanitization, escaping, CSP and security headers in one command. Free and open source under the MIT license.
