$filter service with (if-else)

PHOTO EMBED

Mon Dec 06 2021 07:40:04 GMT+0000 (UTC)

Saved by @GodFather #php

$filterStudents = $search !== null ? [
    'filter[entry_year]' => $entry_year,
    'filter[search]' => $search,
    'relation[student_group]' => 1,
    'page' => (int)$page,
    'per_page' => 20,
] : [
    'filter[entry_year]' => $entry_year,
    'relation[student_group]' => 1,
    'page' => (int)$page,
    'per_page' => 20,
];
content_copyCOPY