PHP code example of linshunwei / laravel-xunsearch

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

    

linshunwei / laravel-xunsearch example snippets


'providers' => [
    //...
    Linshunwei\XunSearchLaravel\XunSearchServiceProvider::class,
    //...
],

    'driver' => env('SCOUT_DRIVER', 'xunsearch'),

    'server_host' => env('XUNSEARCH_SERVER_HOST', '127.0.0.1'),
    'server_index_port' => env('XUNSEARCH_SERVER_INDEX_PORT', '8383'),
    'server_search_port' => env('XUNSEARCH_SERVER_SEARCH_PORT', '8384'),
    'default_charset' => env('XUNSEARCH_DEFAULT_CHARSET', 'utf-8'),

use Illuminate\Database\Eloquent\Model;
use Laravel\Scout\Searchable;

class Article extends Model
{
    use Searchable;
shell
php artisan vendor:publish --provider="Linshunwei\XunSearchLaravel\XunSearchServiceProvider"