}
$perPage = 10;
- $data = Cache::get('select2_' . $hash);
+ $data = Cache::get('select2_' . $hash) ?? [];
$term = request()->get('q', null);
$page = request()->get('page', 1);
$offset = ($page - 1) * $perPage;
if (null === $hash) {
$hash = hash('sha256', print_r($data, true));
}
- Cache::put('select2_' . $hash, $data, 6000);
+ Cache::put('select2_' . $hash, $data, 86400);
return $hash;
}
$data[$k] = ['t' => $v, 'n' => self::normalize($v)];
}
$data = $data + Cache::get('select2_' . $hash);
- Cache::put('select2_' . $hash, $data, 6000);
+ Cache::put('select2_' . $hash, $data, 86400);
}
public function getOptions()