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

Laminas Filter Laravel Package

laminas/laminas-filter

A collection of reusable data filters for PHP apps. Provides string and numeric normalization, file and HTML filters, and a plugin manager to compose filter chains. Useful for sanitizing and transforming input consistently across Laminas and other frameworks.

View on GitHub
Deep Wiki
Context7

Word Filters

In addition to the standard set of filters, there are several classes specific to filtering word strings.

CamelCaseToDash

TIP: New Behaviour since Version 3 The filter will now treat numbers as a word boundary. For example ThisHas4Words will filter to This-Has-4-Words.

This filter modifies a given string such that CamelCaseWords are converted to Camel-Case-Words.

Basic Usage

$filter = new Laminas\Filter\Word\CamelCaseToDash();

print $filter->filter('ThisIsMyContent');

The above example returns This-Is-My-Content.

Supported Options

There are no additional options for Laminas\Filter\Word\CamelCaseToDash.

CamelCaseToSeparator

TIP: New Behaviour since Version 3 The filter will now treat numbers as a word boundary. For example ThisHas4Words with the default separator will filter to This Has 4 Words

This filter modifies a given string such that CamelCaseWords are converted to Camel Case Words.

Basic Usage

$filter = new Laminas\Filter\Word\CamelCaseToSeparator();

print $filter->filter('ThisIsMyContent');

The above example returns This Is My Content.

Supported Options

The following options are supported for Laminas\Filter\Word\CamelCaseToSeparator:

Option Description Type Default
separator A separator character string ' ' (space)

Example

$filter = new Laminas\Filter\Word\CamelCaseToSeparator(['separator' => ':']);

print $filter->filter('ThisIsMyContent');

The above example returns This:Is:My:Content.

CamelCaseToUnderscore

TIP: New Behaviour since Version 3 The filter will now treat numbers as a word boundary. For example ThisHas4Words will filter to This_Has_4_Words

This filter modifies a given string such that CamelCaseWords are converted to Camel_Case_Words.

Basic Usage

$filter = new Laminas\Filter\Word\CamelCaseToUnderscore();

print $filter->filter('ThisIsMyContent');

The above example returns This_Is_My_Content.

Supported Options

There are no additional options for Laminas\Filter\Word\CamelCaseToUnderscore.

DashToCamelCase

This filter modifies a given string such that words-with-dashes are converted to WordsWithDashes.

Basic Usage

$filter = new Laminas\Filter\Word\DashToCamelCase();

print $filter->filter('this-is-my-content');

The above example returns ThisIsMyContent.

Supported Options

There are no additional options for Laminas\Filter\Word\DashToCamelCase:

DashToSeparator

This filter modifies a given string such that words-with-dashes are converted to words with dashes.

Basic Usage

$filter = new Laminas\Filter\Word\DashToSeparator();

print $filter->filter('this-is-my-content');

The above example returns this is my content.

Supported Options

The following options are supported for Laminas\Filter\Word\DashToSeparator:

Option Description Type Default
separator A separator character string ' ' (space)

Example

$filter = new Laminas\Filter\Word\DashToSeparator(['separator' => '+']);

print $filter->filter('this-is-my-content');

The above example returns this+is+my+content.

DashToUnderscore

This filter modifies a given string such that words-with-dashes are converted to words_with_dashes.

Basic Usage

$filter = new Laminas\Filter\Word\DashToUnderscore();

print $filter->filter('this-is-my-content');

The above example returns this_is_my_content.

Supported Options

There are no additional options for Laminas\Filter\Word\DashToUnderscore.

SeparatorToCamelCase

This filter modifies a given string such that words with separators are converted to WordsWithSeparators.

Basic Usage

$filter = new Laminas\Filter\Word\SeparatorToCamelCase();

print $filter->filter('this is my content');

The above example returns ThisIsMyContent.

Supported Options

The following options are supported for Laminas\Filter\Word\SeparatorToCamelCase:

Option Description Type Default
separator A separator character string ' ' (space)

Example

$filter = new Laminas\Filter\Word\SeparatorToCamelCase(['separator' => ':']);

print $filter->filter('this:is:my:content');

The above example returns ThisIsMyContent.

SeparatorToDash

This filter modifies a given string such that words with separators are converted to words-with-separators.

Basic Usage

$filter = new Laminas\Filter\Word\SeparatorToDash();

print $filter->filter('this is my content');

The above example returns this-is-my-content.

Supported Options

The following options are supported for Laminas\Filter\Word\SeparatorToDash:

Option Description Type Default
separator A separator character. string ' ' (space)

Example

$filter = new Laminas\Filter\Word\SeparatorToDash(['separator' => ':']);

print $filter->filter('this:is:my:content');

The above example returns this-is-my-content.

SeparatorToSeparator

This filter modifies a given string such that words with separators are converted to words-with-separators.

Basic Usage

$filter = new Laminas\Filter\Word\SeparatorToSeparator();

print $filter->filter('this is my content');

The above example returns this-is-my-content.

Supported Options

The following options are supported for Laminas\Filter\Word\SeparatorToSeparator:

Option Description Type Default
searchSeparator The search separator character string ' ' (space)
replaceSeparator The replacement separator character string -

Example

$filter = new Laminas\Filter\Word\SeparatorToSeparator([
    'search_separator'      => ':',
    'replacement_separator' => '+',
]);

print $filter->filter('this:is:my:content');

The above example returns this+is+my+content.

UnderscoreToCamelCase

This filter modifies a given string such that words_with_underscores are converted to WordsWithUnderscores.

Basic Usage

$filter = new Laminas\Filter\Word\UnderscoreToCamelCase();

print $filter->filter('this_is_my_content');

The above example returns ThisIsMyContent.

Supported Options

There are no additional options for Laminas\Filter\Word\UnderscoreToCamelCase.

UnderscoreToSeparator

This filter modifies a given string such that words_with_underscores are converted to words with underscores.

Basic Usage

$filter = new Laminas\Filter\Word\UnderscoreToSeparator();

print $filter->filter('this_is_my_content');

The above example returns this is my content.

Supported Options

The following options are supported for Laminas\Filter\Word\UnderscoreToSeparator:

Option Description Type Default
separator A separator character string ' ' (space)

Example

$filter = new Laminas\Filter\Word\UnderscoreToSeparator(['separator' => '+']));

print $filter->filter('this_is_my_content');

The above example returns this+is+my+content.

UnderscoreToDash

This filter modifies a given string such that words_with_underscores are converted to words-with-underscores.

Basic Usage

$filter = new Laminas\Filter\Word\UnderscoreToDash();

print $filter->filter('this_is_my_content');

The above example returns this-is-my-content.

Supported Options

There are no additional options for Laminas\Filter\Word\UnderscoreToDash.

UnderscoreToStudlyCase

This filter modifies a given string such that words_with_underscores are converted to wordsWithUnderscores.

Basic Usage

$filter = new Laminas\Filter\Word\UnderscoreToStudlyCase();

print $filter->filter('this_is_my_content');

The above example returns thisIsMyContent.

Supported Options

There are no additional options for Laminas\Filter\Word\UnderscoreToStudlyCase.

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.
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope
anil/file-picker
broqit/fields-ai