How can I use append attributes with Laravel Eloquent and pagination? We are trying to load the data from Laravel Eloquent, wherein we have to append attributes. So we want to query based on the append attributes, which works fine when not using skip and take. But we need to add the pagination and need the option of skip and take, but return an error.
Model
protected $appends = ['isSlaBreach'];
public function getIsSlaBreachAttribute()
{
return true or false
}
Controller
$overdue_tickets->skip($skip);
$overdue_tickets->take($take);
$res = $overdue_tickets->get()->where('isSlaBreach', true);
Need guidance on the same.