Download the PHP package tanmaymishu/laravel-funnel without Composer

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

Laravel Funnel

Filtering results based on the http query string parameter (?key=value) is one of the common tasks of everyday web development.

Laravel Funnel is an attempt to reduce the cognitive burden of applying and maintaining the filters.

Features

Installation

Use the package manager composer to install laravel-funnel.

Usage

Quick Start:

Let's say you have a Post model and an attribute published and you want to filter all the posts that are published. The URL representation might look like this:

http://example.com/posts?published=1

Step 1: Run php artisan funnel:filter Published. A new Published class inside app/Filters directory will be created and the following configurations will be assumed:

Don't worry, all these "assumed defaults" can be overridden (See CLI options below).

Step 2: Open the model (e.g. Post.php) where you want to use this filter in. Add these two lines in your class:

Then add the filter class in the $filters array. Example:

Step 3: Now you can call Post::filtered() to get the filtered posts. It returns an instance of Builder, allowing you to further chain the query, for example: Post::filtered()->with('comments')->get(). You have to append ->get() as you normally would, to return the result as a collection.

You can add as many filters as you want in the $filters array. Append the parameter in your query string: ?title=foo&published=1 and Funnel will pick up the appropriate filter for you.

CLI Options

Notes:

Examples

Let's take a look at some funnel commands and what result they produce based on the URL:

Model and Relation Considerations:

[Note: The examples below use a mixture of long form options and short form options. Feel free to use any form you like.]

Command URL Result
funnel:filter Title example.com?title=Foo Fetches Post 1
funnel:filter Title example.com?title=Foo,Bar Fetches Post 1 and 2
funnel:filter Title example.com?title[]=Foo&title[]=Bar Fetches Post 1 and 2
funnel:filter Title --clause=orderBy example.com?title=asc Fetches all the posts sorted by title in ascending order
funnel:filter Title -c orderBy (Shorthand) example.com?title=desc Fetches all the posts sorted by title in descending order
funnel:filter Body --operator=like example.com?body=Lorem Fetches Post 1
funnel:filter Search -a body -o like example.com?search=Dolor Fetches Post 2. Specified attr (body) and operator (like) is used instead of defaults.
funnel:filter Comment -a comments.body -o like example.com?comment=Comment B Fetches Post 2. Will return all the posts that contain "Comment B" in their comment's body. body attr of Comment model is used instead of the body attr of the Post model.
funnel:filter Reply -a comments.replies.content -o like example.com?reply=Reply A Fetches Post 1. Will return all the posts that contain "Reply A" in their replies to a comment. content attr of Reply model is used.

Multi-value parameters ([] notation)

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

License

MIT


All versions of laravel-funnel with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
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 tanmaymishu/laravel-funnel contains the following files

Loading the files please wait ....