PHP code example of arunfung / scout-elasticsearch

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

    

arunfung / scout-elasticsearch example snippets


/*
 * Package Service Providers...
 */
Laravel\Scout\ScoutServiceProvider::class,
ArunFung\ScoutElasticSearch\ElasticSearchServiceProvider::class,

php artisan vendor:publish --provider="Laravel\Scout\ScoutServiceProvider"
php artisan vendor:publish --provider="ArunFung\ScoutElasticSearch\ElasticSearchServiceProvider"

// Set scout driver to elasticsearch
SCOUT_DRIVER=elasticsearch

// add index name into .env
ELASTIC_SEARCH_INDEX=index name

// Create a generic index mapping
php artisan es:create-index