Spatie\Analytics\AnalyticsClient::setCacheLifeTimeInMinutes PHP Method

setCacheLifeTimeInMinutes() public method

Set the cache time.
public setCacheLifeTimeInMinutes ( integer $cacheLifeTimeInMinutes ) : self
$cacheLifeTimeInMinutes integer
return self
    public function setCacheLifeTimeInMinutes(int $cacheLifeTimeInMinutes)
    {
        $this->cacheLifeTimeInMinutes = $cacheLifeTimeInMinutes;
        return $this;
    }

Usage Example

 protected static function createAnalyticsClient(array $analyticsConfig, Google_Service_Analytics $googleService) : AnalyticsClient
 {
     $client = new AnalyticsClient($googleService, app(Repository::class));
     $client->setCacheLifeTimeInMinutes($analyticsConfig['cache_lifetime_in_minutes']);
     return $client;
 }