changes
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace App\Containers\Dashboard\Actions\Departments;
|
||||
|
||||
use App\Containers\Education\Models\EducationalProgram;
|
||||
use App\Containers\InstituteStructure\Models\Department;
|
||||
use App\Services\App\Cache\DepartmentCacheService;
|
||||
|
||||
class DetachDepartmentProgramAction
|
||||
{
|
||||
public function __construct(
|
||||
private readonly DepartmentCacheService $cacheService,
|
||||
) {}
|
||||
|
||||
public function run(Department $department, EducationalProgram $program): void
|
||||
{
|
||||
$department->programs()->detach($program->id);
|
||||
|
||||
$this->cacheService->clearAllCacheByModel();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user