When we give cheerfully and accept gratefully, everyone is blessed. - Maya Angelou
Id | Name | Created At | Updated At |
---|
php artisan datatables:scope UserDataTableScope
namespace App\DataTables\Scopes;
use Yajra\Datatables\Contracts\DataTableScopeContract;
class UserDataTableScope implements DataTableScopeContract
{
public function apply($query)
{
return $query->whereBetween('id', [500, 550]);
}
}
public function getUsers(UsersDataTable $dataTable)
{
return $dataTable->addScope(new UserDataTableScope)->render('path.to.view');
}