Commit 8d8a9b7c by Vladislav

fix slice on collection

1 parent 091da35c
Showing with 4 additions and 0 deletions
......@@ -4,6 +4,7 @@ namespace App\Service\Requests;
use App\Models\Tokens;
use App\Service\API\API;
use Ramsey\Collection\Collection;
class APIRequest implements \App\Service\Contract\APIRequest
{
......@@ -107,6 +108,9 @@ class APIRequest implements \App\Service\Contract\APIRequest
private function sliceArray($params, $offset, $length = null): array
{
if ($params instanceof Collection) {
$params = $params->toArray();
}
return array_values(array_slice($params, $offset, $length));
}
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!