Delete expires ots & add duration to create
This commit is contained in:
@@ -0,0 +1,19 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user