Download the PHP package boomdraw/canonicalizer without Composer
On this page you can find all versions of the php package boomdraw/canonicalizer. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download boomdraw/canonicalizer
More information about boomdraw/canonicalizer
Files in boomdraw/canonicalizer
Package canonicalizer
Short Description Canonicalizer package for Laravel
License MIT
Homepage https://github.com/boomdraw/canonicalizer
Informations about the package canonicalizer
Canonicalizer
Canonicalizer package for Laravel
Installation
Via Composer
Laravel
The package will automatically register itself.
Lumen
Uncomment the following line in the bootstrap file:
Register CanonicalizerServiceProvider
Usage examples
or
Methods
Canonicalizer
Canonicalizer::canonicalize()
Args string $string, bool $nullEmpty = true
Returns canonicalized string or null
if $nullEmpty = true
and the string is empty.
Canonicalizer::email()
Args: string $email
Returns canonicalized email without dots before @
or null
if the string does not contain @
Canonicalizer::slug()
Args: string $title, string $separator = '-', ?string $language = 'en'
\Illuminate\Support\Str::slug()
alias
Canonicalizer::url()
Args: string $url, string $separator = '-'
The function calls trim()
function with slash (/
) and backslash (\
) added to charlist and slugs url path items
with specified separator.
Canonicalizer::uri()
Args: sstring $url, string $separator = '-'
Canonicalizer::url()
alias
Canonicalizer::macro()
Args string $name, object|callable $macro = true
Canonicalizer uses Macroable trait, so you can add methods to a class dynamically.
Testing
You can run the tests with:
Contributing
Please see CONTRIBUTING for details and a todo list.
Security
If you discover any security-related issues, please email [email protected] instead of using the issue tracker.