Download the PHP package archy-bold/eloquent-searchable without Composer

On this page you can find all versions of the php package archy-bold/eloquent-searchable. 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 eloquent-searchable

Eloquent Searchable

Add search functionality to Eloquent models in Laravel 5.

This package is a WIP and currently only supports very basic text search in the Java-based elasticsearch currently. I will probably add fallback search functionality in the future, but feel free to fork and add additional third-party search engines.

NOTE: This package is missing many features that means it's only useful for the most basic of searches. See the 'Issues' section for a list of known issues and functionality gaps. Improvements to come!

Requirements

PHP >= 5.4.0

This pakages uses traits which require PHP 5.4. Laravel 5 also requires PHP 5.4.

elasticsearch

The package currently only supports search through elasticsearch, so you'll need server access and to get that running before you can use this package. Download the elasticsearch server here.

Java is also required to use elasticsearch.

Installation

You can install the package through composer with the following command:

Next, run composer update from your command line to get the dependencies.

Then, update config/app.php and add an entry for the service provider.

To get the default config.php file you must run the following command:

Setup

To make one of your models searchable, you should set it up as follows:

Your model should implement SearchableModel and use SearchableTrait. You should also include a $searchable variable for configuration. Currently this only takes a columns argument. This should be an array of columns that should be indexed. You can also reference columns through relationships eg country.name.

NOTE: This only currently supports 1:1 or m:1 relationships. 1:m or m:m relationships are not currently supported.

Next add your model to the search.php config file.

Where the key is a unique name to identify the models in results.

This will allow you to search on models as follows:

Where the returned object is an EloquentCollection of the results.

NOTE: By default, none of your models will be indexed. They will be automatically indexed when created or updated. If you delete a model, it will be removed from the index too.

Usage

As well as searching on the model itself (See above), you can search on all searchable models too.

First get an instance of the search provider by getting it from the app layer:

Or use dependency injection on your controllers.

You then have access to an instance of a SearchProvider (in this case, always an ElasticSearchProvider). You can then call use the searchAll() function.

This returns an array of EloquentCollections, with each collection containing the results for the search on a different model. The array is indexed by the key you chose for the model in the search config.

Dealing With Errors

If you get the following exception:

Elasticsearch isn't running. You'll need to start up the server with bin/elasticsearch where the bin/ directory is wherever you installed your elasticsearch instance.

Issues


All versions of eloquent-searchable with dependencies

PHP Build Version
Package Version
Requires php Version >=5.4.0
illuminate/config Version 5.*
illuminate/database Version 5.*
illuminate/support Version 5.*
elasticsearch/elasticsearch Version ~1.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 archy-bold/eloquent-searchable contains the following files

Loading the files please wait ....