18 lines
361 B
PHP
18 lines
361 B
PHP
<?php
|
|
|
|
namespace App\Services\Auth;
|
|
|
|
use App\Models\PasswordResetRequest;
|
|
|
|
class PasswordResetCleanupService
|
|
{
|
|
public function cleanup(int $days = 30): int
|
|
{
|
|
$threshold = now()->subDays($days)->toDateTimeString();
|
|
|
|
return PasswordResetRequest::query()
|
|
->where('requested_at', '<', $threshold)
|
|
->delete();
|
|
}
|
|
}
|