Skip to content

Commit

Permalink
ADD use of redisRemember helper functions
Browse files Browse the repository at this point in the history
  • Loading branch information
sfneal committed Aug 20, 2020
1 parent 1d81792 commit d7d8753
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/AbstractViewModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
namespace Sfneal\ViewModels;

use Illuminate\Http\Response;
use Illuminate\Support\Facades\Cache;
use Illuminate\Support\Facades\View;
use RuntimeException;
use Spatie\ViewModels\ViewModel;
Expand Down Expand Up @@ -105,8 +104,7 @@ public function render(string $view = null, int $ttl = null)
}

// Cache the View if it doesn't exist
// todo: add use of Cacheable
return Cache::remember($this->redisViewKey(), $this->getTTL($ttl), function () {
return redisRemember($this->redisViewKey(), $this->getTTL($ttl), function () {
return $this->__render();
});
}
Expand Down

0 comments on commit d7d8753

Please sign in to comment.