PHP code example of bagusindrayana / laravel-filter
1. Go to this page and download the library: Download bagusindrayana/laravel-filter 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/ */
bagusindrayana / laravel-filter example snippets
#use trait
use Bagusindrayana\LaravelFilter\Traits\LaravelFilter;
class User extends Authenticatable
{
use HasFactory, Notifiable,LaravelFilter;
//
}
$datas = User::filtersInput(['name','email'],'input_name')->get();
//example if input name is "search" so you should replace input_name with "search"
class User extends Authenticatable
{
use HasFactory, Notifiable,LaravelFilter;
protected $filterFields = [
'name',
'email'
];
}
//you will only need call fuction name
User::filters('john')->get();
User::filtersInput(null,'search')->get();