App\Services\Repositories\Repository::remember PHP Method

remember() public method

Get an item from the repository, or store the default value.
public remember ( string $key, Closure $callback ) : mixed
$key string
$callback Closure
return mixed
    public function remember($key, Closure $callback)
    {
        // If the item exists in the repository we will just return this immediately
        // otherwise we will execute the given Closure and repository the result
        // of that execution for the given number of minutes in storage.
        if (!is_null($value = $this->get($key))) {
            return $value;
        }
        $this->put($key, $value = $callback());
        return $value;
    }