Download the PHP package mobilexco/laravel-scout-elastic without Composer
On this page you can find all versions of the php package mobilexco/laravel-scout-elastic. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package laravel-scout-elastic
Laravel Scout Elasticsearch Driver
This package makes is the Elasticsearch driver for Laravel Scout that works with AWS' Elasticsearch and does not require you to put credentials into .env files.
Contents
- Installation
- Usage
- Credits
- License
Installation
You can install the package via composer:
You must add the Scout service provider and the package service provider in your app.php config:
Configuration
This package assumes you are following good AWS security and /not/ putting password in your Laravel .env files an instead follows the practices outlined in Credentials for the AWS SDK for PHP Version 3. To enable this, set the following variable in your .env.
For local development, inside vagrant for instance, you can use the normal Elasticsearch client by either omitting this variable or setting it as follows.
One thing the AWS client needs is the Region. If you don't already have it in your .env, add it as such.
Testing with Scout
If your CI environment does not have access to a working Elasticsearch instance, any indexed Models will cause it to error. To solve this, add the following to your phpunit.xml. The single quotes wrapping the double quotes are the tricky part there.
Laravel Configuration
After you've published the Laravel Scout package configuration
you'll need to update the main scout configuration
and this package's configuration
and enable the artisan job:
Elasticsearch Configuration
Scout will happily throw an error if it cannot create contact your Elasticsearch server or the index doesn't exist.
Creating an index can be kinda arcane, so if the index doesn't exist, you can include the following artisan command in your deployment stack to check if the index exists, and if it doesnt then it will create it.
Usage
Now you can use Laravel Scout as described in the official documentation
Credits
- Erick Tamayo
- All Contributors
License
The MIT License (MIT).
All versions of laravel-scout-elastic with dependencies
laravel/scout Version ^3.0|^4.0
elasticsearch/elasticsearch Version ^5.0
jsq/amazon-es-php Version ^0.2