October\Rain\Support\Arr

Source: ~/vendor/october/rain/src/Support/Arr.php

Extends:

  • Illuminate\Support\Arr

Array helper

Protected properties

There are no protected properties in the class.

Show inherited protected properties

Inherited protected properties

  • protected static array $macros - defined in Illuminate\Support\Arr. The registered string macros.

Public methods

public static array build(array $array, callable $callback)

Build a new array using a callback.

Parameters
  • array $array
  • callable $callback

Show inherited public methods

Inherited public methods

  • public mixed __call(string $method, array $parameters) - defined in Illuminate\Support\Arr. Dynamically handle calls to the class.
  • public static mixed __callStatic(string $method, array $parameters) - defined in Illuminate\Support\Arr. Dynamically handle calls to the class.
  • public static bool accessible(mixed $value) - defined in Illuminate\Support\Arr. Determine whether the given value is array accessible.
  • public static array add(array $array, string $key, mixed $value) - defined in Illuminate\Support\Arr. Add an element to an array using "dot" notation if it doesn't exist.
  • public static array collapse(array $array) - defined in Illuminate\Support\Arr. Collapse an array of arrays into a single array.
  • public static array crossJoin(array $arrays=NULL) - defined in Illuminate\Support\Arr. Cross join the given arrays, returning all possible permutations.
  • public static array divide(array $array) - defined in Illuminate\Support\Arr. Divide an array into two arrays. One with keys and the other with values.
  • public static array dot(array $array, string $prepend='') - defined in Illuminate\Support\Arr. Flatten a multi-dimensional associative array with dots.
  • public static array except(array $array, array|string $keys) - defined in Illuminate\Support\Arr. Get all of the given array except for a specified array of keys.
  • public static bool exists(ArrayAccess|array $array, string|int $key) - defined in Illuminate\Support\Arr. Determine if the given key exists in the provided array.
  • public static mixed first(array $array, callable|null $callback=NULL, mixed $default=NULL) - defined in Illuminate\Support\Arr. Return the first element in an array passing a given truth test.
  • public static array flatten(array $array, int $depth=INF) - defined in Illuminate\Support\Arr. Flatten a multi-dimensional array into a single level.
  • public static void forget(array &$array, array|string $keys) - defined in Illuminate\Support\Arr. Remove one or many array items from a given array using "dot" notation.
  • public static mixed get(ArrayAccess|array $array, string $key, mixed $default=NULL) - defined in Illuminate\Support\Arr. Get an item from an array using "dot" notation.
  • public static bool has(ArrayAccess|array $array, string|array $keys) - defined in Illuminate\Support\Arr. Check if an item or items exist in an array using "dot" notation.
  • public static bool hasMacro(string $name) - defined in Illuminate\Support\Arr. Checks if macro is registered.
  • public static bool isAssoc(array $array) - defined in Illuminate\Support\Arr. Determines if an array is associative.
  • public static mixed last(array $array, callable|null $callback=NULL, mixed $default=NULL) - defined in Illuminate\Support\Arr. Return the last element in an array passing a given truth test.
  • public static void macro(string $name, object|callable $macro) - defined in Illuminate\Support\Arr. Register a custom macro.
  • public static void mixin(object $mixin) - defined in Illuminate\Support\Arr. Mix another object into the class.
  • public static array only(array $array, array|string $keys) - defined in Illuminate\Support\Arr. Get a subset of the items from the given array.
  • public static array pluck(array $array, string|array $value, string|array|null $key=NULL) - defined in Illuminate\Support\Arr. Pluck an array of values from an array.
  • public static array prepend(array $array, mixed $value, mixed $key=NULL) - defined in Illuminate\Support\Arr. Push an item onto the beginning of an array.
  • public static mixed pull(array &$array, string $key, mixed $default=NULL) - defined in Illuminate\Support\Arr. Get a value from the array, and remove it.
  • public static mixed random(array $array, int|null $number=NULL) - defined in Illuminate\Support\Arr. Get one or a specified number of random values from an array.
  • public static array set(array &$array, string $key, mixed $value) - defined in Illuminate\Support\Arr. Set an array item to a given value using "dot" notation.
  • public static array shuffle(array $array) - defined in Illuminate\Support\Arr. Shuffle the given array and return the result.
  • public static array sort(array $array, callable|string|null $callback=NULL) - defined in Illuminate\Support\Arr. Sort the array using the given callback or "dot" notation.
  • public static array sortRecursive(array $array) - defined in Illuminate\Support\Arr. Recursively sort an array by keys and values.
  • public static array where(array $array, callable $callback) - defined in Illuminate\Support\Arr. Filter the array using the given callback.
  • public static array wrap(mixed $value) - defined in Illuminate\Support\Arr. If the given value is not an array, wrap it in one.

Protected methods

Show inherited protected methods

Inherited protected methods

  • protected static array explodePluckParameters(string|array $value, string|array|null $key) - defined in Illuminate\Support\Arr. Explode the "value" and "key" arguments passed to "pluck".