Download the PHP package szunisoft/laravel-rule-groups without Composer

On this page you can find all versions of the php package szunisoft/laravel-rule-groups. 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-rule-groups

GitHub release Packagist license

Rule Groups

With Laravel it's very easy to run predefined validation rules and customize them. It is also possible to create your own rule in several ways.

One of our projects uses tons of validations and most of them are the same or very similar to each other. This package provides an easy way to make reusable validation rule groups.

The primary advantage of this package is the code reusability with centralized rule group controlling and managing.

Installing

If you are on a lower version of Laravel and you don't have package discovery yet please add the ServiceProvider to the configuration file.

Configuration

By default the package will generate all rule groups into the app/RuleGroups directory. You can change it by publishing the configuration file.

Creating Rule Groups

Writing Rule Groups

Locate the generated class. Default location is app/RuleGroups.

Basic Usage - Reusability

You can easily use rule groups in your controllers. See the example.

This will be equivalent with the following:

Now you can use this validation group in any other controllers or wherever you want to validate.

Advanced Usage - On demand configuration

In this chapter we'll take a closer look at how we can modify these groups in extremist situations.

Let's say we have a registration page where the user must specify the information of the managed company but we also need billing information. That's okay, easy and simple. But what if the managed company and the billing company are not the same one?

Take a look at the following Rule Group

Now let's use it in our controller

This will turn into this

Let's say it's not enough for us and we need almost the same rules but not exactly.

We want to validate the billed company inputs only when the user want to specify different one.

Available methods

After using the static method you can use the following ones:

Attribute management

Utility

Don't forget to invoke the method.


All versions of laravel-rule-groups with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1.3
laravel/framework Version ^5.5
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 szunisoft/laravel-rule-groups contains the following files

Loading the files please wait ....