Skip to content

Commit

Permalink
Update HashidsManagerDecorator.php
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammad-Alavi committed Feb 6, 2025
1 parent cebe8d2 commit babe0fd
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/Support/HashidsManagerDecorator.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,10 +89,6 @@ public function decodeArray(array $hash): array
return array_map(fn ($id) => $this->decode($id), $hash);
}

/**
* without decoding the encoded id's you won't be able to use
* validation features like `exists:table,id`.
*/
public function decodeFields(array $source, array $keys): array
{
$flattened = Arr::dot($source);
Expand All @@ -105,7 +101,7 @@ public function decodeFields(array $source, array $keys): array
}

if (!is_string($value)) {
throw new \RuntimeException('String expected, got ' . gettype($value));
throw new \RuntimeException('String expected, got [' . gettype($value) . ']');
}

$decoded = hashids()->tryDecode($value);
Expand Down

0 comments on commit babe0fd

Please sign in to comment.