Download the PHP package lotuashvili/laravel-scout-elastic-aws without Composer
On this page you can find all versions of the php package lotuashvili/laravel-scout-elastic-aws. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download lotuashvili/laravel-scout-elastic-aws
More information about lotuashvili/laravel-scout-elastic-aws
Files in lotuashvili/laravel-scout-elastic-aws
Package laravel-scout-elastic-aws
Short Description Elastic Driver for Laravel Scout (with AWS IAM capability)
License
Informations about the package laravel-scout-elastic-aws
Laravel Scout Elasticsearch Driver
This package makes the Elasticsearch driver for Laravel Scout that works with AWS Elasticsearch and IAM.
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.
For using IAM credentials, add those to .env.
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
- Levan Lotuashvili
- Erick Tamayo
- All Contributors
License
The MIT License (MIT).