PHP code example of jeylabs / laravel-scout-elastic

1. Go to this page and download the library: Download jeylabs/laravel-scout-elastic 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/ */

    

jeylabs / laravel-scout-elastic example snippets


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

// 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'),
        ],
    ],
...