1. Go to this page and download the library: Download caneara/quest 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/ */
caneara / quest example snippets
DB::table('users')
->whereFuzzy('name', 'jd') // matches John Doe
->first();
User::whereFuzzy('name', 'jd') // matches John Doe
->first();
User::whereFuzzy('name', 'jd') // matches John Doe
->whereFuzzy('email', 'gm') // matches @gmail.com
->first();
User::whereFuzzy(function ($query) {
$query->orWhereFuzzy('name', 'jd'); // matches John Doe
$query->orWhereFuzzy('email', 'gm'); // matches @gmail.com
})->first();
// Before
User::whereFuzzy('name', 'jd')
->having('_fuzzy_relevance_', '>', 70)
->first();
// After
User::whereFuzzy('name', 'jd')
->withMinimumRelevance(70)
->first();
// Returns results which exceed 70 on the name column or 90 on the email column
User::whereFuzzy(function ($query) {
$query->orWhereFuzzy('name', 'jd', 70);
$query->orWhereFuzzy('email', 'gm', 90);
})->get();