PHP code example of adrianopedro / laravel-scout-database-driver

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

    

adrianopedro / laravel-scout-database-driver example snippets


	SCOUT_DRIVER = apsearch
	SCOUT_QUEUE  = true //for queueing the process, if false it will be processed emmidiatly uppon creation/update/delete

//...
'algolia' => [
	'id' => env('ALGOLIA_APP_ID', ''),
	'secret' => env('ALGOLIA_SECRET', ''),
],
//...
'apsearch' => [
    'asYouType'     => true,
    'searchMode'    => "LIKE",  // LIKE, BOOLEAN, NATURAL, DIRECT (direct
                                // search over model collection).
                                // searchModel can also be defined per Model.
],
//...



return [
    //...
    'providers' => [
        //...
        Laravel\Scout\ScoutServiceProvider::class,
        AdrianoPedro\Scout\APSearchScoutServiceProvider::class,
    ],
    //...
];      



namespace App\Model;

//..
use Laravel\Scout\Searchable;


class Model extends Model
{
    //..
    use Searchable;

    public searchMode = "LIKE"; // Optional. If not defined config/scout.php
                                // option will be used.
bash
php artisan vendor:publish --tag=apsearch-migrations
bash
php artisan migrate --path=/database/migrations/create_searchables_table.php
bash
php artisan apsearch:import Path\\To\\Model