1
0
mirror of https://github.com/flextype/flextype.git synced 2025-08-06 21:26:48 +02:00

feat(helpers): add collectionFromQueryString helper

This commit is contained in:
Awilum
2022-05-09 16:30:34 +03:00
parent 4ea6528ed9
commit 9fe7d6f062

View File

@@ -69,6 +69,20 @@ if (! function_exists('collectionWithRange')) {
}
}
if (! function_exists('collectionFromQueryString')) {
/**
* Create a new arrayable object from the given query string.
*
* @param string $string Input query string.
*
* @return Collection
*/
function collectionFromQueryString(string $string): Collection
{
return Collection::createFromQueryString($string);
}
}
if (! function_exists('filterCollection')) {
/**
* Filter collection.