From 9fe7d6f062a6480cb80cd9fa51decafd92ae2a7f Mon Sep 17 00:00:00 2001 From: Awilum Date: Mon, 9 May 2022 16:30:34 +0300 Subject: [PATCH] feat(helpers): add `collectionFromQueryString` helper --- src/flextype/helpers/collection.php | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/flextype/helpers/collection.php b/src/flextype/helpers/collection.php index a3fa4853..ed20a886 100644 --- a/src/flextype/helpers/collection.php +++ b/src/flextype/helpers/collection.php @@ -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.