benyi/laravel-more-macros

为 illuminate/support 或 Laravel Macroble 类提供更多宏。

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

This package is auto-updated.

Last update: 2024-09-11 18:09:15 UTC


README

为 illuminate/support 或 Laravel Macroble 类提供更多宏。

先决条件

安装

composer require benyi/laravel-more-macros

方法

查看 bootstrap.php 文件列表。

/**
 * 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)