Download the PHP package pomirleanu/eloquent-elastic without Composer

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

Elodex - Eloquent Indexing Library

Latest Stable Version Build Status Master-Branch StyleCI Total Downloads License

Development branch: Build Status Develop-Branch

Elodex provides an easy way to implement synchronization of your Laravel Eloquent models with an Elasticsearch index.

Your Eloquent database will remain your main data source while you can use the full capacity of Elasticsearch for any index based search on your models.

Table of Contents

Requirements

Elodex requires Elasticsearch 2.0 or higher, PHP v5.6+ and Laravel 5.1+.

Besides the technical requirements you should have a profound knowledge of Eloquent and you should be familiar with the basic Elasticsearch terms and how Elasticsearch works in general.

Branching Model

This project uses the Gitflow branching model:

Installation

Elodex can be directly added to your project via Composer:

Or you can manually add the required entry to your composer.json file in the require section :

Laravel Integration

To integrate Elodex into your Laravel application you first need to add the IndexServiceProvider to the list of service providers in the application configuration.

This can be done by editing the app.php file in the config folder. Search for the providers section and add a new entry:

Configuration

Even though Elodex does ship with a default configuration which should work for standard Elasticsearch installations you usually want to specify your own settings. You can do so by publishing the standard config file to your application:

This will copy a standard config to config/elodex.php. Make sure your Elasticsearch host configuration is correct and that you specify a default index name for your application which will be used for all your indexed Eloquent models by default.

Extending your Eloquent Model Classes

There are two possibilities to add indexing capabilities to your Eloquent model classes.

1. Using the IndexedModel Trait

To add the basic indexing functionality to your existing Eloquent models you can include the IndexedModel trait which automatically implements the needed Contracts\IndexedModel interface for you.

Note that the trait implements the newCollection method. You must make sure your Eloquent class doesn't overwrite this method, otherwise you're going to lose the convenient way to use indexing operations on the collections returned by model queries.

The IndexedModel trait does three things for you:

  1. it implements the Contracts\IndexedModel interface and thus makes the model capable of being added to an index repository.
  2. it adds a convenient way to access the default index manager and the default index repository for your model class.
  3. it adds the methods to interact with the index repository. This includes adding your model instances to the index repository, removing them and performing an index based search.

2. Deriving from the Elodex Model Class

Deriving from the abstract Elodex Model class is a better approach than the trait if your existing model directly inherits from the Eloquent base model class. It gives you the possibility to override and thus extend the existing methods added by the IndexedModel trait without having to rewrite them completely.

A common use case would be if you want to change the document creation of your model.

Index Repositories

All indexed model documents are managed in a repository with the type IndexRepository. Each model class has its own default index repository using its own type in the index.

This means you can't share an index repository with different model classes, trying to do so will result in exceptions during runtime.

The default index repository used for a class can be accessed through the getClassIndexRepository static method.

There's usually no need to access the index repository directly since the indexed model classes provide a more convenient method to manage the repository entries.

Elasticsearch Client

Elodex uses the official PHP low-level client for Elasticsearch. There's usually no need to access this client directly but Elodex makes a client instance globally available in case you need to perform some custom or raw queries.

You may also use dependency injection with the ElasticsearchClientManager class to get a client instance.

Caching

Can be enabled from the config file as needed. Only when using:

Caching the eloquent query from the mysql, will serve the desired info from cache.

You have to create sync for the modules need caching and set a caching key prefix in the model you need, won't cache if this is not being set:

Documentation

A detailed Elodex documentation can be found here.

Changelog

The changelog can be found here.

License

Elodex is an open source project licensed under the the MIT license. Please see the License File for further information.


All versions of eloquent-elastic with dependencies

PHP Build Version
Package Version
Requires php Version >=5.6.4
laravel/framework Version 5.4.*
nesbot/carbon Version 1.*
elasticsearch/elasticsearch Version 2.2.*
ongr/elasticsearch-dsl Version 2.*
monolog/monolog Version 1.*
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 pomirleanu/eloquent-elastic contains the following files

Loading the files please wait ....