Файловый менеджер - Редактировать - /home/clickysoft/public_html/somni.clickysoft.net/app/Console/Commands/EmailVerificationCheck.php
Назад
<?php namespace App\Console\Commands; use Illuminate\Console\Command; use App\Models\User; use Carbon\Carbon; class EmailVerificationCheck extends Command { /** * The name and signature of the console command. * * @var string */ protected $signature = 'app:email_verification_check'; /** * The console command description. * * @var string */ protected $description = 'Check if user verified email, if not, then user will be deactivated'; /** * Execute the console command. */ public function handle() { $landlord = User::whereHas('roles',function($query){ $query->whereTitle('Landlord'); })->get(); if($landlord->isNotEmpty()){ foreach ($landlord as $user) { if ($user->email_verified_at === null) { // Check if it's been 10 days since the user was created $createdAt = Carbon::parse($user->created_at); $currentDate = Carbon::now(); if ($createdAt->diffInDays($currentDate) >= 10) { // Update the is_active column to 0 $user->update(['is_active' => 0]); } } } } $this->info('Successfully Ran Email Verification Landlord Command.'); } }
| ver. 1.4 |
Github
|
.
| PHP 8.1.29 | Генерация страницы: 0 |
proxy
|
phpinfo
|
Настройка