Download the PHP package alvarofpp/expand-request without Composer

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

expand-request

Packagist Version License

A package to make it easy to manipulate your requests and more.

Contents

Install

Install via composer:

Usage

This package currently contains:

Checks whether the current request url belongs to a pattern

You can check whether the request url belongs to a url pattern or route pattern. Use this methods:

By default, $request is the current request.

Example: You can use this to activate a class in your menu, such as:

These methods accept a array as the first parameter, so that you can check various patterns:

Another example is that you can use it to check where the user is coming from:

UrlParameters

Add url parameters to be validated in your FormRequest. Use the trait UrlParameters in your FormRequest, such as:

If your url is [GET] /courses/{course}, you can validate the parameter course in your $rules:

Rename url parameters

If you want rename the parameter, just declare the variable $renameUrlParameters. Example: you have a url /courses/{course}/contents/{content}/videos/{video}, you can use:

Declare the index in the array to decide which parameter will change:

Remove extra parameters

Use the trait RemoveExtraParameters in your FormRequest to remove extra parameters:

This trait uses the $accept property. By default the values in $accept are a merge of the keys present in rules() and attributes(). You can specify which fields are accepted in your FormRequest specifying in $accept.

In this example, if you receive a request such as {"field_1": 50, "field_2": 100, "extra_field": 1}, the extra_field will be removed from that request.

Contributing

Contributions are more than welcome. Fork, improve and make a pull request. For bugs, ideas for improvement or other, please create an issue.


All versions of expand-request with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2.0
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 alvarofpp/expand-request contains the following files

Loading the files please wait ....