Download the PHP package forrestedw/query-url-builder without Composer

On this page you can find all versions of the php package forrestedw/query-url-builder. 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 query-url-builder

Easy query url building

Packagist Version License: MIT Test

This packages makes it easy to make the links necessary for use in the front en with spatie/laravel-query-builder. The package is amazing helpful for the back end, and the front end is outside of the scope of the project. Creating the links for the front end can be verbose. This package makes it easy.

Installation

Basic usage

For greatest convenience, use it from the facade.

Sort

Set a sort

Access the sort

Reverse the sort

Remove a sort

Filter

Check if a filter is set

Set filters

Filters can also be set using an associative array:

Remove a filter

Combine various sort and filter options

forUrl()

By default, QueryUrl returns the new query params for the route you are already on:

If you need a different url, use forUrl(). It accepts plain urls or named routes:


Using in blade

Use the queryUrl() in your blade files like below.

Sorting

The following example will create a link that cycles through three states of being sorted:

  1. Sorted A-Z
  2. Sorted Z-A
  3. Unsorted.

The url text shows what sort the user will currently be seeing. The link will take the user to the next sort state.

Filtering

A similar approach is taken for boolean value filtering, and cycling through the three states:

  1. Show true only
  2. Show false only
  3. Show all

Blade components

For ease, the two above trios of if-else links can be outputted using the following, respectively:

Behind the scenes the sort or filter attribute is handled to snake case it for the attribute in question. For example, the sort example displays First Name (exactly as passed) but sorts for first_name.



All versions of query-url-builder with dependencies

PHP Build Version
Package Version
Requires php Version ^7.1|^8.0
illuminate/support Version ^6.0|^7.0|^8.0|^9.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 forrestedw/query-url-builder contains the following files

Loading the files please wait ....