Closed flycoo closed 11 months ago
According to the source, caching forever can be done by using
/**
* Indicate that the query results should be cached forever.
*
* @return \Illuminate\Database\Query\Builder|static
*/
public function cacheForever()
{
return $this->cacheFor(-1);
}
$Test = Test::cacheFor(0)->where('ip', '127.0.0.1')->first();
as the code above. when I delete my record from db, the $Test remain would be retreive and it's not null