benyi/laravel-more-macros

Provides more macros for illuminate/support or Laravel Macroble classes.

v0.0.4 2020-06-11 08:25 UTC

This package is auto-updated.

Last update: 2024-04-11 17:14:37 UTC


README

Provides more macros for illuminate/support or Laravel Macroble classes.

Prerequisites

Installation

composer require benyi/laravel-more-macros

Methods

See bootstrap.php file listing.

/**
 * Check if an item is not exists in an array using "dot" notation.
 *
 * @param \ArrayAccess|array $array
 * @param string $key
 * @return array
 */
Illuminate\Support\Arr::absent($array, $key)


/**
 * "Un-dot" the flattened array into multi-dimensional structure.
 *
 * @param array $array
 * @return array
 */
Illuminate\Support\Arr::undot($array)


/**
 * Diff the collection with the given items (case insensitive)
 *
 * @param mixed $items
 * @return $this
 */
Illuminate\Support\Collection::diffCi($items)


/**
 * Determines if the given string is a valid DateTime format.
 *
 * @param string|null $time
 * @param \DateTimeZone|string|null $tz
 * @return bool
 */
Illuminate\Support\Carbon::recognized($time, $tz)


/**
 * Determines if the given string is not a valid DateTime format.
 *
 * @param string|null $time
 * @param \DateTimeZone|string|null $tz
 * @return bool
 */
Illuminate\Support\Carbon::unrecognized($time, $tz)