PHP code example of zesty-bus / laravel-simple-search
1. Go to this page and download the library: Download zesty-bus/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/ */
zesty-bus / laravel-simple-search example snippets
php
$posts = Post::search($request->query)->get();
sh
php artisan vendor:publish --provider="ZestyBus\LaravelSimpleSearch\LaravelSimpleSearchServiceProvider" --tag="config"
php
return [
/**
* Name of the eloquent builder method.
*/
'method' => 'filter',
/**
* Name of the models public searchable property.
*/
'property' => 'filterable'
];
php
$posts = Post::filter($request->query, ['name'])->get();