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