Skip to content

Commit

Permalink
Make shuffle work for collections (#2709)
Browse files Browse the repository at this point in the history
  • Loading branch information
danijelk authored Oct 28, 2020
1 parent d450dd1 commit e86d27f
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Modifiers/CoreModifiers.php
Original file line number Diff line number Diff line change
Expand Up @@ -1823,6 +1823,10 @@ public function shuffle($value)
return collect($value)->shuffle()->all();
}

if ($value instanceof Collection) {
return $value->shuffle();
}

return Stringy::shuffle($value);
}

Expand Down

0 comments on commit e86d27f

Please sign in to comment.