php-tenant/Jobs/ComputeUserStats.php
Snider d0ad2737cb refactor: rename namespace from Core\Mod\Tenant to Core\Tenant
Simplifies the namespace hierarchy by removing the intermediate Mod
segment. Updates all 118 files including models, services, controllers,
middleware, tests, and composer.json autoload configuration.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-27 16:30:46 +00:00

43 lines
893 B
PHP

<?php
declare(strict_types=1);
namespace Core\Tenant\Jobs;
use Core\Tenant\Models\User;
use Core\Tenant\Services\UserStatsService;
use Illuminate\Bus\Queueable;
use Illuminate\Contracts\Queue\ShouldQueue;
use Illuminate\Foundation\Bus\Dispatchable;
use Illuminate\Queue\InteractsWithQueue;
use Illuminate\Queue\SerializesModels;
class ComputeUserStats implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
public int $tries = 3;
public int $backoff = 30;
/**
* Create a new job instance.
*/
public function __construct(
public int $userId
) {}
/**
* Execute the job.
*/
public function handle(UserStatsService $statsService): void
{
$user = User::find($this->userId);
if (! $user) {
return;
}
$statsService->computeStats($user);
}
}