Download the PHP package schenke-io/laravel-url-cleaner without Composer

On this page you can find all versions of the php package schenke-io/laravel-url-cleaner. 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-url-cleaner

Version Downloads Tests License PHP

Laravel URL cleaner - clean and concise

The Laravel URL Cleaner package sanitizes URLs by removing unnecessary SEO parameters, tracking information, and other clutter, ensuring clean and efficient URL handling in your Laravel applications.

To install just run:

  composer require schenke-io/laravel-url-cleaner

Here a code example:

Operation principle

The core UrlCleaner class iteratively applies a series of specialized cleaner classes to a given URL. Each cleaner class performs a specific modification to check and clean the URL for the following reasons:

This cleaner classes are highly extensible, allowing for customization and the creation of new modification types.

Config

A default configuration file can be installed and later modified, you can install it with:

A typical result could be:

key type description cleaner
cleaners array list of cleaner classes applied to the given URL any
max_length_value int values longer than this are removed by RemoveLongValues
masks array additional masks to be used RemoveConfigMasks
protected_keys array key names which are guard against removal any
class name # masks description
Marketing00 68 Marketing00
Marketing01 106 Marketing01
Marketing02 43 Marketing02
Marketing03 170 Marketing03
Marketing04 111 Marketing04
MarketingBroad 245 MarketingBroad
MarketingNarrow 333 MarketingNarrow
MarketingUnique 374 MarketingUnique
PreventInvalidHost - PreventInvalidHost
PreventLocalhost - PreventLocalhost
PreventNonHttps - PreventNonHttps
PreventUserPassword - PreventUserPassword
RemoveConfigMasks - RemoveConfigMasks
RemoveLongValues - RemoveLongValues
RemoveSearch - RemoveSearch
ShortAmazonProductUrl - ShortAmazonProductUrl
SortParameters - SortParameters

The use of masks

The core process of URL parameter removal utilizes specific masks.

Description Example mask
exact match of one query key on any domain utm_campaign
match of some keys on any domain utm*
*tm
*
exact match of one query key on one domain [email protected]
exact match of one query key on some domains utm_campaign@test.*
utm_campaign@*test.*
match of some keys on one domain utm_*@test.net
*x*@test.net
match of some keys on some domains utm_*@test.*
*x*@*test.*

Some examples are outlined in the table below.

Mask URL 1
test.com/?a=1&b=2
URL 2
test.net/?a=1&abb=2
URL 3
test2.com/?a=1&b=2
a test.com/?b=2 test.net/?abb=2 test2.com/?b=2
a* test.com/?b=2 test.net/ test2.com/?b=2
test.com@a test.com/?b=2 test.net/?a=1&abb=2 test2.com/?a=1&b=2
test.*@a test.com/?b=2 test.net/?abb=2 test2.com/?a=1&b=2

Build your own cleaner by extending special classes

To extend the list of cleaners you can build your own cleaners and put them in the config file config/url-cleaner.php

The following cleaners are prepared to be extended for custom applications:

Prevent domain names

Extend PreventLocalhost and overwrite the $hostRegExes array with regular expressions matching unwanted hostnames.

Prevent schemes

Extend PreventNonHttps and overwrite the $allowedSchemes array with scheme you allow to pass.

Use your own masks

Extend RemoveSearch and overwrite the $masks array with masks you want to exclude.

Rewrite urls

Extend ShortAmazonProductUrl and overwrite the clean() method using the class as an example.

AI Skills

Title Description
url-cleaner-development Build and work with Laravel URL Cleaner features, including creating custom cleaners and managing URL sanitization logic.

When to use

Use this skill when you need to:

Features

Creating Custom Cleaners

You can create new cleaners by extending the BaseCleaner class. Custom cleaners allow for domain-specific or parameter-specific logic that isn't covered by the default cleaners.

Configuration-Driven Sanitization

The package is highly configurable. You can enable or disable cleaners, set maximum value lengths, and define protected keys that should never be removed.

Facade Support

The package provides a convenient UrlCleaner facade for easy integration and mocking in tests.


Markdown file generated by schenke-io/packaging-tools


All versions of laravel-url-cleaner with dependencies

PHP Build Version
Package Version
Requires php Version ^8.3
ext-curl Version *
ext-json Version *
ext-simplexml Version *
archtechx/enums Version ^1.1
guzzlehttp/guzzle Version ^7.9
spatie/laravel-package-tools Version ^1.30
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 schenke-io/laravel-url-cleaner contains the following files

Loading the files please wait ...