Assuming the Laravel cache used redis
$roles = Cache::store('redis')->rememberForever(
"roles-123456",
function () {
return Role::where('team_id', 12345)
->get();
}
);
Cache can only be cleared by
Cache::store('redis')->forget("roles-123456");
$roles = Cache::store('redis')->rememberForever(
"roles-123456",
function () {
return Role::where('team_id', 12345)
->get();
}
);
Cache::store('redis')->forget("roles-123456");
0 comments:
Post a Comment