Skip to content

ArtisanPack UI home

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
terminal
$ 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.

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

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

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.1.0

RBAC

Roles with hierarchy, permissions, Blade directives and Gate integration.

v1.0.1

Security Auth

2FA (email + TOTP), password complexity, account lockout and sessions.

v1.0.1

Security Advanced Auth

WebAuthn / passkeys, SSO, social login, biometrics and device fingerprinting.

v1.0.1

Secure Uploads

File validation, malware scanning, signed-URL storage and quarantine.

v1.2.0

Security Analytics

Event logging, anomaly detection, SIEM export and incident response.

v1.1.0

Compliance

GDPR, CCPA and LGPD consent, data subject rights, DPIA and reporting.

Meta

Security Full

One require that bundles the entire security suite at coordinated versions.

Harden your app with Security

Sanitization, escaping, CSP and security headers in one command. Free and open source under the MIT license.