Download the PHP package jonpurvis/squeaky without Composer

On this page you can find all versions of the php package jonpurvis/squeaky. 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 squeaky

Squeaky

A Laravel Validation Rule that helps catch profanity in your application.

Tests GitHub last commit Packagist PHP Version GitHub issues GitHub Packagist Downloads

Introduction

Squeaky (short for Squeaky Clean) is a Laravel validation rule that you can add your Laravel application, to ensure any user submitted input such as a name or biography, is free of profanity and therefore, clean. Just add new Clean() to your rules and you're good to go!

Squeaky is powered by Profanify, which is a PestPHP Plugin that does the same thing, but for code. By utilising the profanity in that package, Squeaky is powerful from the get-go and provides support for numerous locales, not just English.

Installation

To install Squeaky, you can run the following command in your project's root:

Examples

Let's take a look at how Squeaky works. As it's a Laravel Validation rule, there's not really that much to it. You would use it in the same way you would use a custom validation rule you've added yourself.

Let's take the following scenario where we have a form that allows a user to enter their name, email and bio:

You'll notice that both name and bio are using the Clean rule. This rule will take the value and ensure that it doesn't exist in the profanity config files that the package has. By default, it will use your app locale, so if your locale is set to en, it will scan profanity in the en profanity config.

If profanity is found, an error will appear in the validation errors array and will be shown to your user (if your application does this).

Some applications allow for more than one language, so you're able to pass in additional locales to the rule to cater for them. Below is an example showing how to cater for both en and it:

Alternatively, instead of passing an array of strings to the rule, you can pass in an array of JonPurvis\Squeaky\Enums\Locale enums to specify the locales:

This will then check the locale config for any locale you've passed in (providing the config exists!). If profanity is found in any of them, an error will appear in the validation errors.

The really cool thing about this, is the error will be returned in the language that failed. So if the failure was found in the it profanity list, the package assumes the user is Italian and returns the error message in Italian to let them know that their value is not clean.

Languages

Squeaky currently supports the following languages:

Contributing

Contributions to the package are more than welcome! Depending on the type of change, there's a few extra steps that will need carrying out:

Existing Locale Changes

These changes should be done in Profanify and a new release should be tagged. Dependabot will then open a PR on this repo. Once that's been merged, it should be good to go because the config will already be getting loaded.

New Locale Support

The new locale config will need adding to Profanify first and a new release should be tagged. Dependabot will then open a PR on this repo. Additionally, the new config will need loading in within the boot method of the service provider of this package.

A new case will also need adding to the JonPurvis/Squeaky/Enums/Locale enum to support the new locale.

Functionality Changes

For changes to how this rule works, these should be done in this package. No change needed to Profanify.


All versions of squeaky with dependencies

PHP Build Version
Package Version
Requires php Version ^8.2
illuminate/contracts Version ^10.0|^11.0|^12.0
pestphp/pest-plugin-profanity Version ^3.22
spatie/laravel-package-tools Version ^1.16
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 jonpurvis/squeaky contains the following files

Loading the files please wait ....