From dff510d6dbe51c6d9a0c62ec6f6a0d87ea2d1050 Mon Sep 17 00:00:00 2001 From: Derrick Austin Date: Fri, 29 May 2026 14:34:31 -0500 Subject: [PATCH] Fix: cache the access token with cache()->put() for Laravel 12 compatibility _authenticate() cached the token with the array-set helper form cache(['sigma_access_token' => $token], 60). Under Laravel 12 that helper calls app('cache')->put(key, value, ttl: $ttl) with a NAMED ttl argument; CacheManager::__call forwards it via ...$parameters and throws 'Unknown named parameter $ttl' on stores whose put() signature does not name the parameter $ttl. Use cache()->put('sigma_access_token', $token, 60) (positional TTL), which works on Laravel 9-12. Fixes Sigma REST auth failing under the Curator L12 upgrade. --- src/SigmaREST.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/SigmaREST.php b/src/SigmaREST.php index 87abf0c..e0fdbb6 100644 --- a/src/SigmaREST.php +++ b/src/SigmaREST.php @@ -114,8 +114,12 @@ protected function _authenticate(): void } $this->token = $token; - // Cache the access token for one hour - cache(['sigma_access_token' => $this->token], 60); + // Cache the access token for one hour. + // Use cache()->put() (positional TTL) rather than the array-set form cache([...], 60): + // under Laravel 12 the array-set helper calls app('cache')->put(key, value, ttl: $ttl) + // with a NAMED ttl argument, which CacheManager::__call forwards via ...$parameters and + // throws "Unknown named parameter $ttl" on stores whose put() does not name it $ttl. + cache()->put('sigma_access_token', $this->token, 60); } /**