1. Go to this page and download the library: Download larasquad/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/ */
public function from($value)
{
$this->query->whereDate('date', '>', $value);
}
public function to($value)
{
$this->query->whereDate('to', '>', $value);
}
public function index(Request $request)
{
//
}
public function index(UserFilter $filter)
{
//
}
use Larasquad\Filter\Traits\Filterable;
class User extends Authenticatable
{
use Filterable;
}
public function index(UserFilter $filter)
{
$users = User::filter($filter)->get();
return view('pages.users.index', compact('users'));
}
/**
* Filters the first_name column of the resource
*
* @return void
*/
public function firstName($value)
{
$this->query->where('first_name', 'like', "%{$value}%");
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.