Download the PHP package overtrue/laravel-text-guard without Composer

On this page you can find all versions of the php package overtrue/laravel-text-guard. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package laravel-text-guard

Laravel TextGuard

A powerful string sanitization and normalization tool for Laravel that can be used as validation rules or standalone utility.

English Documentation

Documentation

Installation

Publish Configuration

Basic Usage

As a Utility

As Validation Rules

Model Auto-Filtering

Use the TextGuardable trait to provide automatic filtering for model fields:

When the model is saved, specified fields are automatically filtered:

Dynamic Field Management

FormRequest Integration

Pipeline Usage

Laravel TextGuard provides 14 built-in pipeline steps for text processing. Each pipeline step can be configured with specific parameters to meet different requirements.

Available Pipeline Steps

Basic Text Processing

Unicode Processing

HTML Processing

Character Filtering

Length Control

Pipeline Configuration Examples

Basic Text Cleaning

Username Processing

Rich Text Processing

Nickname with Emoji Support

Pipeline Parameter Types

The system automatically passes configuration to constructors based on type:

Usage Tips

  1. Order matters: Pipeline steps are executed in configuration order
  2. Basic cleanup first: Start with trim_whitespace, collapse_spaces, remove_control_chars, remove_zero_width
  3. Unicode processing: Use unicode_normalization and fullwidth_to_halfwidth for international text
  4. HTML handling: Use whitelist_html for rich text, strip_html for plain text
  5. Length control last: Place visible_ratio_guard and truncate_length at the end

For detailed parameter information and more examples, see the Pipeline Guide.

Preset Configurations

Level-based Presets

safe Preset

Default preset suitable for most normal text input fields. Includes basic text sanitization features.

strict Preset

More restrictive filtering mode with stricter rules:

Function-specific Presets (Examples)

username Preset

Suitable for username input with stricter normalization.

nickname Preset

Suitable for user nicknames with emoji and Chinese punctuation support.

rich_text Preset

Suitable for rich text content, preserving safe HTML tags.

Extended Features

Register Custom Pipeline Steps

Get Available Steps

Create Custom Pipeline Steps

Constructor Configuration

All Pipeline steps now use constructor configuration, following traditional OOP design:

Configuration Passing Mechanism

The system automatically passes configuration to constructors based on type:

Real-world Usage Scenarios

User Registration Form

Article Content Management

Comment System

Search Keyword Processing

Batch Data Processing

Custom Pipeline Steps

Features

Testing

Code Quality

This project follows strict code quality standards:

License

MIT License


All versions of laravel-text-guard with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
illuminate/support Version ^12.0|^13.0
ext-mbstring Version *
ext-intl Version *
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package overtrue/laravel-text-guard contains the following files

Loading the files please wait ...