Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions src/Traits/UsersOnlineTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ public function allOnline()

public function isOnline()
{
return Cache::has($this->getCacheKey());
return Cache::driver('file')->has($this->getCacheKey());
}

public function leastRecentOnline()
Expand All @@ -35,7 +35,7 @@ public function mostRecentOnline()

public function getCachedAt()
{
if (empty($cache = Cache::get($this->getCacheKey()))) {
if (empty($cache = Cache::driver('file')->get($this->getCacheKey()))) {
return 0;
}

Expand All @@ -44,7 +44,7 @@ public function getCachedAt()

public function setCache($seconds = 300)
{
return Cache::put(
return Cache::driver('file')->put(
$this->getCacheKey(),
$this->getCacheContent(),
$seconds
Expand All @@ -53,7 +53,7 @@ public function setCache($seconds = 300)

public function getCacheContent()
{
if (!empty($cache = Cache::get($this->getCacheKey()))) {
if (!empty($cache = Cache::driver('file')->get($this->getCacheKey()))) {
return $cache;
}
$cachedAt = Carbon::now();
Expand All @@ -66,7 +66,7 @@ public function getCacheContent()

public function pullCache()
{
Cache::pull($this->getCacheKey());
Cache::driver('file')->pull($this->getCacheKey());
}

public function getCacheKey()
Expand Down