1. Go to this page and download the library: Download baril/sqlout 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/ */
// Restrict the search to some fields only:
$builder->only('title');
$builder->only(['title', 'excerpt']);
// (use the same names as in the toSearchableArray method)
// Retrieve the total number of results:
$nbHits = $builder->count();
$results = Post::search('you see what happens larry')
->published() // the `published` scope is defined in the Post class
->where('date', '>', '2010-10-10')
->get();
$results = Post::search('ve vant ze money lebowski')
->scope(function ($query) {
$query->within('something');
})
->get();