Hello! Please, explain to me, what is this?
With a chance, it removes the tokens?
private function collectGarbage()
{
if ($this->hitsLottery()) {
AccessToken::whereRaw('last_activity <= ? - lifetime', [time()])->delete();
...
}
}
private function hitsLottery()
{
return mt_rand(1, 100) <= 2;
}