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

Blasp Laravel Package

blaspsoft/blasp

Advanced profanity filtering for Laravel with driver-based detection (regex/pattern/phonetic/pipeline), multi-language support, severity scoring (0–100), masking strategies, validation rules, middleware, Eloquent model integration, events, and test fakes.

View on GitHub
Deep Wiki
Context7

Product Decisions This Supports

  • Compliance & Safety: Enforce brand guidelines, legal requirements (e.g., COPPA, GDPR), or platform policies (e.g., "no profanity in comments").
  • User Experience: Balance moderation with usability—e.g., masking mild profanity while rejecting extreme cases.
  • Roadmap Priorities:
    • Build vs. Buy: Avoid reinventing a profanity filter wheel; leverage this package’s multi-language support, severity scoring, and driver architecture instead of custom regex.
    • Scalability: Use the pipeline driver to chain regex + phonetic for high accuracy without performance hits.
    • Localization: Ship with Spanish/German/French support; extend to other languages via Blasp::in().
  • Use Cases:
    • Comments/Forums: Reject profanity in user-generated content (e.g., CheckProfanity middleware).
    • Messaging Apps: Mask profanity in real-time (e.g., Blasp::mask('grawlix')).
    • APIs: Validate incoming data (e.g., Profanity validation rule).
    • Eloquent Models: Auto-sanitize fields like Comment::body via Blaspable trait.
    • Analytics: Track profanity trends with ProfanityDetected events.

When to Consider This Package

  • Adopt if:
    • Your app handles user-generated content (comments, reviews, chat) and needs consistent moderation.
    • You require multi-language support (e.g., global audience) or severity-based filtering (e.g., allow "damn" but block "fuck").
    • You want flexibility to customize detection (e.g., regex for obfuscation, phonetic for sound-alikes) or masking (e.g., grawlix for humor).
    • Your team lacks time/resources to maintain a custom profanity filter (this package is batteries-included).
    • You need integration with Laravel’s ecosystem (Eloquent, validation, middleware, Blade directives).
  • Look elsewhere if:
    • You need real-time moderation (e.g., live chat) and require sub-10ms latency—this package’s regex driver may be too slow for high-throughput systems (consider a dedicated API like blasp.app).
    • Your use case is niche (e.g., filtering medical jargon) and the package’s word lists are insufficient.
    • You’re not using Laravel/PHP—this package is Laravel-specific (though it powers a universal API).
    • You need whitelisting for specific contexts (e.g., "allow profanity in game chat but not reviews")—this requires custom middleware logic.

How to Pitch It (Stakeholders)

For Executives: *"Blasp is a turnkey profanity filter for Laravel that saves us from building and maintaining a custom solution. It handles obfuscated slurs, multi-language content, and severity-based moderation—all while integrating seamlessly with our stack. For example:

  • Comments/Forums: Auto-rejects extreme profanity (e.g., fuck) but masks mild words (e.g., damn) to keep discussions civil.
  • APIs: Validates user input in real-time, reducing support costs from flagged content.
  • Scalability: The pipeline driver combines regex (for evasions like f*ck) and phonetic (for sound-alikes like phuck) without sacrificing performance.
  • Cost: Free to use (MIT license), with optional paid tiers for the [blasp.app API] if we need to scale beyond self-hosted limits. This aligns with our brand safety and user experience goals while reducing engineering overhead."*

For Engineering: *"Blasp is a highly extensible profanity filter with:

  • Driver Architecture: Swap between regex (accurate but slower), pattern (fast exact matches), or phonetic (catches sound-alikes like sheit for shit). Chain them with the pipeline driver.
  • Severity Scoring: Words are categorized as mild/moderate/high/extreme, letting us set thresholds (e.g., reject only high severity).
  • Laravel Integrations:
    • Middleware: Reject or sanitize profanity in incoming requests (blasp:sanitize,mild).
    • Eloquent: Add the Blaspable trait to auto-sanitize model fields like Comment::body.
    • Validation: Use Profanity::in('spanish')->maxScore(50) in form rules.
    • Blade: @clean($comment->body) masks profanity in views.
  • Performance: Caches results by default (configurable TTL) and supports batch checking for bulk operations.
  • Extensibility: Add custom drivers, word lists, or masking strategies via config. Trade-offs:
  • The regex driver is CPU-intensive for high-volume traffic (monitor blasp logs).
  • False positives may require tuning the phonetic driver’s max_distance_ratio or adding words to false_positives. Recommendation: Start with the pipeline driver (default: regex + phonetic) and adjust severity thresholds based on A/B tests. Use the middleware for API endpoints and Blaspable for Eloquent models."*
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.
davejamesmiller/laravel-breadcrumbs
artisanry/parsedown
christhompsontldr/phpsdk
enqueue/dsn
bunny/bunny
enqueue/test
enqueue/null
enqueue/amqp-tools
bower-asset/punycode
bower-asset/inputmask
bower-asset/jquery
bower-asset/yii2-pjax
laravel/nova
spatie/laravel-mailcoach
spatie/laravel-superseeder
laravel/liferaft
nst/json-test-suite
danielmiessler/sec-lists
jackalope/jackalope-transport
twbs/bootstrap4