Download the PHP package mr-luke/searcher without Composer

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

Searcher - Laravel Eloquent query Package.

Latest Stable Version Total Downloads License

This package is responsible for converting OData(-like) URL Query into SQL query on top of the Eloquent Builder.

Getting Started

Searcher has been developed using Laravel 5.5. It's recommended to test it out before using with previous versions. PHP >= 7.1.3 is required.

Installation

To install through composer, simply put the following in your composer.json file and run composer update

Or use the following command

Next, add the service provider to app/config/app.php

Configuration

You can see the options for further customization in the config file.

You can also publish config file

Usage

Step 1: Model

To use Searcher you need to setup your Searchable Eloquent model before. Add following interface to the model Mrluke\Searcher\Contracts\Searchable and create method:

['first' => 'firstName'] in this example first is public key (URL) and firstName is an Eloquent attribute. You can be more accured and specify the way that query should be performed by using dot notation.

You can also use Mrluke\Searcher\Traits\Searchable that gives ability to read configuration from class property instead of function.

Step 2: Controller

You can access Searcher via Facade Mrluke\Searcher\Facades\Searcher. All you need is following line

setModel($model, Builder $builder = null) : self

This is main method of package. It is required to perform any action.

This method provides ability to setup Searcher is tree different ways.

  1. Default Model searchableConfig with no additional SQL requirements.

  2. Default Model searchableConfig with custom Builder (eg: whereIn condition not depended on Url query)

  3. Custom searchableConfig passed as 1st argument with Model Builder instance.

By default Seracher uses Illuminate\Http\Request::all() as an input array.

setQuery(array $inputs) : self

This method allows you to set own inputs array instead of using default Illuminate\Http\Request::all()

setOptions(array $options) : self

This method allows you to override default Searcher configuration. If you'd like to check all available options see config file.

getBuilder() : Builder

This method returns prepared Builder instance for given inputs.

get() : Collection

This method returns Illuminate\Support\Collection for given inputs. If your configuration has property auto_pagination = true, it will perform pagination based on limit & offset inputs.

paginate(int $limit = null, int $offset = null) : mixed

This method allows you to get paginated collection of models. If parameters are not set, method will get them automatically from the inputs. If your configuration has property api_mode = true, method will return Illuminate\Support\Collection otherwise you will get Illuminate\Pagination\LengthAwarePaginator.

Plans

To be continued...


All versions of searcher with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.3
illuminate/database Version ^5.5
illuminate/support 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 mr-luke/searcher contains the following files

Loading the files please wait ....