20 lines
423 B
PHP
20 lines
423 B
PHP
<?php
|
|
|
|
namespace App\Console\Commands;
|
|
|
|
use App\Models\OneTimeSecret;
|
|
use Illuminate\Console\Attributes\Signature;
|
|
use Illuminate\Console\Command;
|
|
|
|
#[Signature('app:delete-expired-one-time-secrets')]
|
|
class DeleteExpiredOneTimeSecrets extends Command
|
|
{
|
|
/**
|
|
* Execute the console command.
|
|
*/
|
|
public function handle(): void
|
|
{
|
|
OneTimeSecret::whereDate('expires_at', '<', now())->delete();
|
|
}
|
|
}
|