PHP code example of pascalvgemert / laravel-simple-search

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

    

pascalvgemert / laravel-simple-search example snippets


class Post extends \Illuminate\Database\Eloquent\Model
{
    use SimpleSearch/SimpleSearch;

    /**
     * Specifiy the columns to search on, and add a weight score if needed.
     * Default weight: 1
     *
     * @var array
     */
    protected $searchable = [
        'title:3',
        'content',
    ];
}