PHP code example of swisnl / laravel-fulltext

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

    

swisnl / laravel-fulltext example snippets


class Country extends Model
{

    use \Swis\Laravel\Fulltext\Indexable;

    protected $indexContentColumns = ['biographies.name', 'political_situation', 'elections'];
    protected $indexTitleColumns = ['name', 'governmental_type'];

}

$search = new \Swis\Laravel\Fulltext\Search();
$search->run('europe');
bash
php artisan laravel-fulltext:one \\App\\Models\\Country 4