mirror of
https://github.com/VueFileManager/vuefilemanager.git
synced 2026-05-13 16:55:01 +00:00
added schedule for delete users older as 30 days
This commit is contained in:
@@ -9,7 +9,6 @@ use App\Models\Folder;
|
||||
use App\Models\Setting;
|
||||
use Illuminate\Support\Str;
|
||||
use App\Services\SetupService;
|
||||
use Illuminate\Support\Carbon;
|
||||
use Illuminate\Console\Command;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
|
||||
@@ -88,7 +87,7 @@ class SetupDevEnvironment extends Command
|
||||
'role' => 'admin',
|
||||
'email' => 'howdy@hi5ve.digital',
|
||||
'password' => bcrypt('vuefilemanager'),
|
||||
'email_verified_at' => Carbon::now(),
|
||||
'email_verified_at' => now(),
|
||||
]);
|
||||
|
||||
$user
|
||||
@@ -129,7 +128,7 @@ class SetupDevEnvironment extends Command
|
||||
'role' => 'user',
|
||||
'email' => $this->faker->email,
|
||||
'password' => bcrypt('vuefilemanager'),
|
||||
'email_verified_at' => Carbon::now(),
|
||||
'email_verified_at' => now(),
|
||||
]);
|
||||
|
||||
$newbie
|
||||
|
||||
@@ -41,6 +41,10 @@ class Kernel extends ConsoleKernel
|
||||
}
|
||||
})->everySixHours();
|
||||
|
||||
$schedule->call(function () use ($scheduler) {
|
||||
$scheduler->delete_unverified_users();
|
||||
})->everySixHours();
|
||||
|
||||
// Run queue jobs every minute
|
||||
$schedule->command('queue:work --stop-when-empty')
|
||||
->everyMinute()
|
||||
|
||||
@@ -3,6 +3,7 @@ namespace App\Services;
|
||||
|
||||
use Carbon\Carbon;
|
||||
use App\Models\Zip;
|
||||
use App\Models\User;
|
||||
use App\Models\Share;
|
||||
use Illuminate\Support\Facades\Log;
|
||||
use Illuminate\Support\Facades\Storage;
|
||||
@@ -74,4 +75,19 @@ class SchedulerService
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete unverified users older as 30 days
|
||||
*/
|
||||
public function delete_unverified_users(): void
|
||||
{
|
||||
User::where('created_at', '<=', now()->subDay(30)->toDateString())
|
||||
->where('email_verified_at', null)
|
||||
->get()
|
||||
->each(function ($user) {
|
||||
|
||||
// Delete users
|
||||
$user->delete();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -92,34 +92,5 @@
|
||||
"/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~2fac28cc.js": "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~2fac28cc.js?id=57c854adb91ed9a9d088",
|
||||
"/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~d5e36d91.js": "/vendors~chunks/admin~chunks/admin-account~chunks/app-appearance~chunks/app-billings~chunks/app-email~d5e36d91.js?id=170765b4fd923b62195c",
|
||||
"/vendors~chunks/files~chunks/platform~chunks/shared~chunks/shared-files~chunks/shared/file-browser~ch~52c14f2e.js": "/vendors~chunks/files~chunks/platform~chunks/shared~chunks/shared-files~chunks/shared/file-browser~ch~52c14f2e.js?id=66afa0e341251a68c3d3",
|
||||
"/vendors~chunks/platform~chunks/shared.js": "/vendors~chunks/platform~chunks/shared.js?id=eb141834bc24b72d8e92",
|
||||
"/chunks/app-others.4a1880c5e5279e443415.hot-update.js": "/chunks/app-others.4a1880c5e5279e443415.hot-update.js",
|
||||
"/chunks/app-others.65fc70ed6cd855b5f739.hot-update.js": "/chunks/app-others.65fc70ed6cd855b5f739.hot-update.js",
|
||||
"/chunks/app-others.ec7781305c199afd7ac1.hot-update.js": "/chunks/app-others.ec7781305c199afd7ac1.hot-update.js",
|
||||
"/chunks/app-others.8b1366ac8c6c3d51a360.hot-update.js": "/chunks/app-others.8b1366ac8c6c3d51a360.hot-update.js",
|
||||
"/chunks/app-others.ee1c494b6e7c65ef457d.hot-update.js": "/chunks/app-others.ee1c494b6e7c65ef457d.hot-update.js",
|
||||
"/chunks/app-others.bdcb16d88a2f534975b1.hot-update.js": "/chunks/app-others.bdcb16d88a2f534975b1.hot-update.js",
|
||||
"/chunks/app-others.d7ea54db66f0d57ed713.hot-update.js": "/chunks/app-others.d7ea54db66f0d57ed713.hot-update.js",
|
||||
"/chunks/app-others.f5d5675c971c27d1f7e9.hot-update.js": "/chunks/app-others.f5d5675c971c27d1f7e9.hot-update.js",
|
||||
"/chunks/sign-in.184793cba19c4befae4f.hot-update.js": "/chunks/sign-in.184793cba19c4befae4f.hot-update.js",
|
||||
"/chunks/sign-in.a9ecea30dd01a6e837ed.hot-update.js": "/chunks/sign-in.a9ecea30dd01a6e837ed.hot-update.js",
|
||||
"/chunks/sign-in.cdc378238cd3ebffb0f4.hot-update.js": "/chunks/sign-in.cdc378238cd3ebffb0f4.hot-update.js",
|
||||
"/chunks/sign-in.50ca919fad3f9a6b0c7a.hot-update.js": "/chunks/sign-in.50ca919fad3f9a6b0c7a.hot-update.js",
|
||||
"/chunks/sign-in.2f00413d818bda25eb35.hot-update.js": "/chunks/sign-in.2f00413d818bda25eb35.hot-update.js",
|
||||
"/chunks/sign-in.2a7a8d0a41dd6c30c0ed.hot-update.js": "/chunks/sign-in.2a7a8d0a41dd6c30c0ed.hot-update.js",
|
||||
"/chunks/sign-in.8ea3e1a7d9dd1a70b024.hot-update.js": "/chunks/sign-in.8ea3e1a7d9dd1a70b024.hot-update.js",
|
||||
"/chunks/sign-in.dc398a4251e46ac97944.hot-update.js": "/chunks/sign-in.dc398a4251e46ac97944.hot-update.js",
|
||||
"/chunks/sign-in.3adea8208d6fc3821797.hot-update.js": "/chunks/sign-in.3adea8208d6fc3821797.hot-update.js",
|
||||
"/chunks/sign-in.9efe4a4c966f1960aba3.hot-update.js": "/chunks/sign-in.9efe4a4c966f1960aba3.hot-update.js",
|
||||
"/chunks/sign-in.6d963727e5c35fb26e6e.hot-update.js": "/chunks/sign-in.6d963727e5c35fb26e6e.hot-update.js",
|
||||
"/chunks/sign-in.8d5c9b43872d4f560074.hot-update.js": "/chunks/sign-in.8d5c9b43872d4f560074.hot-update.js",
|
||||
"/chunks/sign-in.de26ebb8f5305618ba79.hot-update.js": "/chunks/sign-in.de26ebb8f5305618ba79.hot-update.js",
|
||||
"/chunks/sign-in.7406fea0a099e3a8665a.hot-update.js": "/chunks/sign-in.7406fea0a099e3a8665a.hot-update.js",
|
||||
"/chunks/sign-in.8da4f2ef76780a6c56c0.hot-update.js": "/chunks/sign-in.8da4f2ef76780a6c56c0.hot-update.js",
|
||||
"/chunks/sign-in.bf19d64759c9e9b5239f.hot-update.js": "/chunks/sign-in.bf19d64759c9e9b5239f.hot-update.js",
|
||||
"/chunks/sign-in.28b0b83732ce321c4e39.hot-update.js": "/chunks/sign-in.28b0b83732ce321c4e39.hot-update.js",
|
||||
"/chunks/sign-up.1a6fc69e814f5c2081cf.hot-update.js": "/chunks/sign-up.1a6fc69e814f5c2081cf.hot-update.js",
|
||||
"/chunks/sign-up.2eeea0f4a373d3154966.hot-update.js": "/chunks/sign-up.2eeea0f4a373d3154966.hot-update.js",
|
||||
"/chunks/sign-up.824b863643bbc69324a0.hot-update.js": "/chunks/sign-up.824b863643bbc69324a0.hot-update.js",
|
||||
"/chunks/sign-up.1ca02954735d934e513e.hot-update.js": "/chunks/sign-up.1ca02954735d934e513e.hot-update.js"
|
||||
"/vendors~chunks/platform~chunks/shared.js": "/vendors~chunks/platform~chunks/shared.js?id=eb141834bc24b72d8e92"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user