The simplest acts of kindness are by far more powerful then a thousand heads bowing in prayer. - Mahatma Gandhi
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');
}