From 0a1317c13d3e3741f037e2a530c595e93bc0c430 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=83=86=E3=82=AF=E3=83=8B=E3=82=AB=E3=83=AB=E8=AB=8F?= =?UTF-8?q?=E8=A8=AA=E5=AD=90?= Date: Tue, 1 Feb 2022 11:40:45 +0900 Subject: [PATCH] =?UTF-8?q?=E8=87=AA=E5=8B=95=E3=81=A7=E6=9C=89=E5=8A=B9?= =?UTF-8?q?=E6=9C=9F=E9=99=90=E5=88=87=E3=82=8C=E3=81=9F=E3=83=88=E3=83=BC?= =?UTF-8?q?=E3=82=AF=E3=83=B3=E3=82=92=E5=89=8A=E9=99=A4=E3=81=95=E3=82=8C?= =?UTF-8?q?=E3=82=8B=E6=A7=98=E3=81=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/Console/Kernel.php | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/backend/app/Console/Kernel.php b/backend/app/Console/Kernel.php index 69914e99..8f47767f 100644 --- a/backend/app/Console/Kernel.php +++ b/backend/app/Console/Kernel.php @@ -5,6 +5,9 @@ namespace App\Console; use Illuminate\Console\Scheduling\Schedule; use Illuminate\Foundation\Console\Kernel as ConsoleKernel; +use App\Models\TelActivation; +use App\Models\EmailActivation; + class Kernel extends ConsoleKernel { /** @@ -24,6 +27,18 @@ class Kernel extends ConsoleKernel */ protected function schedule(Schedule $schedule) { + $schedule->call(function () { + foreach (TelActivation::get() as $t) { + if (time() > strtotime($t->ttl)) { + TelActivation::where('id', $t->id)->delete(); + } + } + foreach (EmailActivation::get() as $e) { + if (time() > strtotime($e->ttl)) { + EmailActivation::where('id', $e->id)->delete(); + } + } + })->everyMinute(); // $schedule->command('inspire')->hourly(); }