Skip to content

Instantly share code, notes, and snippets.

View RedisLock.php
namespace Illuminate\Cache;
use Redis;
use RedisCluster;
use UnexpectedValueException;
class RedisLock extends Lock
derekmd / Optional.php
Last active Dec 27, 2020
Laravel global helper function `optional()`
View Optional.php
namespace App\Support;
class Optional
* The target being transformed.
* Use _ prefix to avoid namespace conflict on __get()
derekmd / Data_dot_data_has.php
Last active Jun 12, 2017
data_dot() and data_has() helper function compliments to PHP framework Laravel. Supports stdClass, Collection, or Arrayable objects along with standard PHP arrays. The intention is to allow nested wildcard pattern matching on structured data.
View Data_dot_data_has.php
// app/helpers.php
// Why don't you let us order files, Gist?
use Illuminate\Support\Arr;
if (!function_exists('data_dot')) {
* Flatten a multi-dimensional object with dots.