Skip to content
This repository has been archived by the owner on Mar 14, 2024. It is now read-only.

Commit

Permalink
Laravel 5.4.16 changes (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
besologic authored Mar 24, 2017
1 parent f2761d8 commit 5354af0
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/Illuminate/Support/Arr.php
Original file line number Diff line number Diff line change
Expand Up @@ -516,4 +516,15 @@ public static function where($array, callable $callback)
{
return array_filter($array, $callback, ARRAY_FILTER_USE_BOTH);
}

/**
* If the given value is not an array, wrap it in one.
*
* @param mixed $value
* @return array
*/
public static function wrap($value)
{
return ! is_array($value) ? [$value] : $value;
}
}

0 comments on commit 5354af0

Please sign in to comment.