u12206050 / elastic-app-scout-driver
Elastic app search driver for Laravel Scout
Requires
- php: ^7.2
- elastic/app-search: ^7.3
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.16
- laravel/scout: ^8.0
- orchestra/testbench: ^5.2
- phpstan/phpstan: ^0.12.32
- phpunit/phpunit: ^8.5
This package is not auto-updated.
Last update: 2024-12-21 03:31:40 UTC
README
Elastic App Search driver for Laravel Scout.
Contents
Compatibility
The current version of Elastic App Scout Driver has been tested with the following configuration:
- PHP 7.2-7.4
- Elasticsearch 7.0-7.6
- Laravel 6.x-7.x
- Laravel Scout 7.x-8.x
Requirements
- Laravel Scout
- Elasticsearch 7.0-7.6
- App Search 7.0-7.6
Installation
The library can be installed via Composer:
composer require u12206050/elastic-app-scout-driver
Configuration
Change the driver
option in the config/scout.php
file to elastic_app
php artisan vendor:publish --provider="ElasticAppScoutDriver\ServiceProvider"
Add your Elastic App Search url and key to you .env
file
ELASTIC_APP_ENDPOINT=
ELASTIC_APP_KEY=
Basic usage
This driver uses Elastic App Search Meaning you can have alot more flexible where clauses available READ MORE
$orders = App\Order::search('')->where('created_at', [ 'from' => '2020-01-01T12:00:00+00:00', 'to' => '2020-12-31T12:00:00+00:00' ]);
When the query string is omitted, then all records are returned.
$orders = App\Order::search()->where('user_id', 1)->get();
Please refer to the official Laravel Scout documentation and the app search api for more details and usage examples.
Maintain
All PRs and RFCs are very welcome.