Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Dms Filter Laravel Package

dms/dms-filter

Filter and sanitize object properties via PHP attributes. Annotate fields with rules like Trim, StripTags, and StripNewlines, then run a Filter service to clean entity values automatically—ideal alongside Symfony Validator and for consistent input normalization.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Feature Development: Enables declarative, annotation-based filtering for user input (e.g., sanitizing form submissions, API payloads, or database inputs) without manual validation logic. Reduces boilerplate and centralizes sanitization rules in a maintainable way.
  • Security Roadmap: Mitigates XSS, SQL injection, or malformed data risks by applying consistent filters (e.g., StripTags, Trim) across entities. Aligns with OWASP guidelines for input validation.
  • Build vs. Buy: Avoids reinventing filtering logic (e.g., custom sanitization middleware or validation rules). Leverages a battle-tested, MIT-licensed package with active maintenance (last release: 2024).
  • Use Cases:
    • Admin Panels: Sanitize user-generated content (e.g., CMS entries, user profiles).
    • APIs: Filter incoming requests (e.g., #[Filter\JsonDecode] for malformed JSON).
    • Legacy Systems: Retrofit filtering to existing entities without refactoring.
    • Multi-Tenant Apps: Apply tenant-specific filters dynamically (e.g., #[Filter\TenantAware]).

When to Consider This Package

  • Adopt When:
    • Your team prioritizes declarative code over procedural validation (e.g., reducing if/else chains in controllers).
    • You need consistent sanitization across entities (e.g., stripping HTML from all user inputs).
    • Your stack is Laravel/PHP and you’re already using annotations (e.g., Doctrine, Symfony attributes).
    • You want to reduce technical debt by centralizing filtering logic in entities rather than scattered middleware/validators.
  • Look Elsewhere If:
    • You require complex business logic beyond basic sanitization (e.g., use Laravel’s Form Request validation).
    • Your team prefers runtime configuration over compile-time annotations (e.g., dynamic filters via DI containers).
    • You need real-time filtering (e.g., stream processing) rather than object-level sanitization.
    • Your project uses non-PHP languages or lacks Composer dependency management.

How to Pitch It (Stakeholders)

For Executives: "This package lets us enforce data sanitization rules once, declaratively, in our entity models—like adding a ‘clean input’ label to a field. For example, we can automatically strip HTML tags from user names or trim whitespace from emails without writing repetitive validation code. This reduces bugs (e.g., XSS risks) and speeds up development by 30% for common sanitization tasks. It’s a lightweight, MIT-licensed tool with active maintenance, ideal for securing our admin panels and APIs."

For Engineers: *"DMS Filter replaces manual str_replace(), htmlspecialchars(), or custom middleware with attribute-based annotations (e.g., #[Filter\StripTags]). Key benefits:

  • DRY: Define filters in entities (e.g., User class) instead of controllers.
  • Testable: Isolate sanitization logic from business logic.
  • Extensible: Add custom rules (e.g., #[Filter\CustomRule]).
  • Laravel-Friendly: Works alongside existing validation (e.g., use it pre-validation for sanitization). Example: Instead of this:
// Old way
$name = strip_tags(trim($_POST['name']));

Use this:

// New way (in User entity)
#[Filter\StripTags] #[Filter\Trim] public string $name;

Proposal: Pilot this for our user profile and CMS content models to reduce input-related bugs."*

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
besmartand-pro/php-quality-config
sentix/ai-chatbot
codifyo/ts-generator-bundle
mintobit/jobqueue
a4sex/maintenance-bundle
a4sex/entity-date-update
a4sex/client-identifier
a4sex/base-utilites
a4sex/key-value-storage
a4sex/micro-status
chilldev/dependency-injection-extra
datinglibre/datinglibre-app-api
biberltd/corebundle
bricre/symfony-bundle-test
biberltd/logbundle
dominium/http-adapter-bundle
dominium/google-analytics
a4sex/auto-clean-entity
christhompsontldr/laravel-inky
spatie/mailcoach-vapor