Skip to content

Instantly share code, notes, and snippets.

@dvlpp
Last active August 22, 2019 10:28
Show Gist options
  • Save dvlpp/878df86f0d9b0b32eda0eb74a3cbd935 to your computer and use it in GitHub Desktop.
Save dvlpp/878df86f0d9b0b32eda0eb74a3cbd935 to your computer and use it in GitHub Desktop.
PassengerSharpList
function getListData(EntityListQueryParams $params)
{
$passengers = Passenger::with(["travel"]);
if($birthdateFilter = $params->filterFor("birthdate")) {
$passengers->whereBetween("birth_date", [
$birthdateFilter['start'],
$birthdateFilter['end'],
]);
}
return $this->transform($passengers->paginate(30));
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment