<?php

namespace App\Traits;

// use Rennokki\QueryCache\Traits\QueryCacheable as RennokkiQueryCacheable;

trait QueryCacheable
{
    // use RennokkiQueryCacheable;

    /**
     * Specify the amount of time to cache queries.
     * Set it to null to disable caching.
     *
     * @return int|\DateTime
     */
    protected function cacheForValue()
    {
        // NOTE: will ignore model $this->cacheFor value.
        return config('query-cacheable.enable') ? config('query-cacheable.seconds') : null;
    }
}
