Skip to content

Commit 5e43ec7

Browse files
committed
Add the ability to get the all searchable keys
1 parent d5baea4 commit 5e43ec7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/Repositories/AbstractRepository.php

+12
Original file line numberDiff line numberDiff line change
@@ -287,6 +287,18 @@ public function orderBy($column, $direction)
287287
});
288288
}
289289

290+
/**
291+
* Return searchable keys.
292+
*
293+
* @return array
294+
*/
295+
public function getSearchableKeys()
296+
{
297+
return array_values(array_map(function($value, $key) {
298+
return is_array($value) ? $key : $value;
299+
}, $this->searchable, array_keys($this->searchable)));
300+
}
301+
290302
/**
291303
* Filter results by given query params.
292304
*

0 commit comments

Comments
 (0)