PHP code example of lotuashvili / laravel-scout-elastic-aws

1. Go to this page and download the library: Download lotuashvili/laravel-scout-elastic-aws library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

lotuashvili / laravel-scout-elastic-aws example snippets


// config/app.php
'providers' => [
    ...
    Laravel\Scout\ScoutServiceProvider::class,
    ...
    ScoutEngines\Elasticsearch\ElasticsearchProvider::class,
],

ELASTICSEARCH_PROVIDER=aws

ELASTICSEARCH_PROVIDER=elastic

AWS_REGION=us-west-2

AWS_ACCESS_KEY=
AWS_ACCESS_SECRET=
AWS_ACCESS_TOKEN=

// config/scout.php
// Set your driver to elasticsearch
    'driver' => env('SCOUT_DRIVER', 'elasticsearch'),

...
    'elasticsearch' => [
        'index' => env('ELASTICSEARCH_INDEX', 'laravel'),
        'hosts' => [
            env('ELASTICSEARCH_HOST', 'http://localhost'),
        ],
    ],
...

// config/laravel-scout-elastic.php
// set this if you don't want to .
    'region' => env('AWS_REGION', 'us-west-2'),
...

// App/Console/Kernel.php
protected $commands = [
    ...
    \ScoutEngines\Elasticsearch\Commands\CreateIndex::class,
    ...
],
xml
<env name="SCOUT_DRIVER" value='"null"' />
bash
php artisan vendor:publish  --provider="ScoutEngines\Elasticsearch\ElasticsearchProvider"
bash
php artisan scout:create-index