This commit is contained in:
F4ilji
2026-04-07 17:54:26 +05:00
parent 04adba6682
commit 936b1fb5b0
468 changed files with 43498 additions and 4176 deletions
@@ -0,0 +1,26 @@
<?php
namespace App\Containers\Dashboard\Actions\Departments;
use App\Containers\InstituteStructure\Models\Department;
use App\Containers\User\Models\User;
use App\Services\App\Cache\DepartmentCacheService;
class UpdateDepartmentTeacherAction
{
public function __construct(
private readonly DepartmentCacheService $cacheService,
) {}
public function run(Department $department, User $user, array $data): void
{
$department->teachers()->updateExistingPivot($user->id, [
'teaching_position' => $data['teaching_position'],
'service_email' => $data['service_email'] ?? null,
'service_phone' => $data['service_phone'] ?? null,
'cabinet' => $data['cabinet'] ?? null,
]);
$this->cacheService->clearAllCacheByModel();
}
}