Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Array Laravel Package

minwork/array

Minwork Array provides fast, well-tested helpers for nested, associative, and object arrays. Get/set/has plus map, filter, find, group, sort, and validation, with fluent-style chaining. No dependencies; modern PHP syntax.

View on GitHub
Deep Wiki
Context7

Finding

find

Definition

Arr::find(array|Iterator|IteratorAggregate $array, callable $condition, string $return = self::FIND_RETURN_VALUE): mixed|mixed[]

Description

Find array (or iterable object) element(s) that match specified condition.

Modes ($return method argument)

Constant name Description
FIND_RETURN_VALUE Return first value of an array that match find condition
FIND_RETURN_KEY Return first key of an array that match find condition
FIND_RETURN_ALL Return array of all values (preserving original keys) that match find condition

Examples

$array = [
  'a' => 0, 
  'b' => 1, 
  3 => 'c', 
  4 => 5
];


Arr::find($array, 'boolval') -> 1
Arr::find($array, function ($element) {
  return is_string($element);
}) -> 'c'


Arr::find($array, 'boolval', Arr::FIND_RETURN_KEY) -> 'b'
Arr::find($array, function ($element) {
  return is_string($element);
}, Arr::FIND_RETURN_KEY) -> 3


Arr::find($array, 'boolval', Arr::FIND_RETURN_ALL) -> 
[
  'b' => 1, 
  3 => 'c', 
  4 => 5
]

Arr::find($array, function ($element) {
  return is_string($element);
}, Arr::FIND_RETURN_ALL) -> 
[
  3 => 'c',
]

Arr::find($array, function ($element) {
  return is_number($element);
}, Arr::FIND_RETURN_ALL) -> 
[
  'a' => 0,
  'b' => 1,
  4 => 5
]
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
coleus/frame
thtg88/journalism
filagora/filagora-ai-forums
rlacerda83/query-parser
socialdept/atp-orm
cboxdk/laravel-assistant-client
socialdept/atp-resolver
socialdept/tenant-domains
tautvydasr/blade-class-names
socialdept/color-scales
maherelgamil/controller
coleus/widgets
coleus/table
coleus/users
coleus/music
coleus/health
coleus/calendar
coleus/notes
coleus/support
coleus/settings