'providers' => [
App\Providers\RouteServiceProvider::class,
/*
* Third Party Service Providers...
*/
Devchithu\LaravelFilterSortingSearchable\Providers\FilterSortingSearchableProvider::class,
],
use Devchithu\LaravelFilterSortingSearchable\Traits\FilterSortingSearchable;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword, FilterSortingSearchable;
...
...
}
use Devchithu\LaravelFilterSortingSearchable\Traits\FilterSortingSearchable;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword, FilterSortingSearchable;
...
...
/**
* The table sorting order asc and desc.
*
* @var string
*/
public $sorting = [
'id',
'name',
'email',
'created_at',
];
}
public function index(Request $request)
{
$users = User::sorting()->get();
return view('user.index', ['users' => $users]);
}
use Devchithu\LaravelFilterSortingSearchable\Traits\FilterSortingSearchable;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword, FilterSortingSearchable;
...
...
/**
* The table filter order asc and desc.
*
* @var string
*/
public $filterable = [
'id',
'name',
'email'
];
}
public function index(Request $request)
{
$users = User::filterable()->get();
return view('user.index', ['users' => $users]);
}
use Devchithu\LaravelFilterSortingSearchable\Traits\FilterSortingSearchable;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword, FilterSortingSearchable;
...
...
/**
* The table sorting order asc and desc.
*
* @var string
*/
public $sorting = [
'id',
'name',
'email',
'created_at',
];
/**
* The table filter.
*
* @var string
*/
public $filterable = [
'id',
'name',
'email'
];
}
public function index(Request $request)
{
$users = User::sorting()->filterable()->get();
return view('user.index', ['users' => $users]);
}
public function index(Request $request)
{
$users = User::sorting()->filterable()->paginate(20);
return view('user.index', ['users' => $users]);
}
use Devchithu\LaravelFilterSortingSearchable\Traits\FilterSortingSearchable;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword, FilterSortingSearchable;
...
...
/**
* The table searchable.
*
* @var string
*/
public $searchable = [
'id',
'name',
'email'
];
}
public function index(Request $request)
{
$users = User::searchable()->get();
return view('user.index', ['users' => $users]);
}
public function index(Request $request)
{
$users = User::sorting()->filterable()->searchable()->get();
return view('user.index', ['users' => $users]);
}
use Devchithu\LaravelFilterSortingSearchable\Traits\FilterSortingSearchable;
class User extends Model implements AuthenticatableContract, CanResetPasswordContract
{
use Authenticatable, CanResetPassword, FilterSortingSearchable;
...
...
/**
* The table filter.
*
* @var string
*/
public $customfilterable = [
'name',
'status',
];
}