ryanmitchell
Dear Ryan,
Thank you your response,
Sorry to say, unfortunately that fixes did`t worked for me, so have fall back to below code:
public function scopeListFrontEnd($query, $options = [])
{
extract(array_merge([
'page' => 1,
'pageLimit' => 20,
'enabled' => TRUE,
'sort' => 'menu_priority asc',
'group' => null,
'location' => null,
'category' => null,
'search' => '',
], $options));
$searchableFields = ['menu_name', 'menu_description'];
if (strlen($location) AND is_numeric($location)) {
$query->whereHasOrDoesntHaveLocation($location);
}
if (strlen($category)) {
$query->whereHas('categories', function ($q) use ($category) {
$q->whereSlug($category);
});
}
if (!is_array($sort)) {
$sort = [$sort];
}
foreach ($sort as $_sort) {
if (in_array($_sort, self::$allowedSortingColumns)) {
$parts = explode(' ', $_sort);
if (count($parts) < 2) {
$parts[] = 'desc';
}
[$sortField, $sortDirection] = $parts;
$query->orderBy($sortField, $sortDirection);
}
}
$search = trim($search);
if (strlen($search)) {
$query->search($search, $searchableFields);
}
if (strlen($group)) {
$query->whereHas('categories', function ($q) use ($group) {
$q->groupBy($group);
});
}
if ($enabled) {
$query->isEnabled();
}
return $query->paginate($pageLimit, $page);
}
Was affected to Item search and category selection. Now those are working back for me! π
Thank you very much.