Rework admin panel and other

This commit is contained in:
F4ilji
2025-04-02 18:37:20 +05:00
parent 49072e50c7
commit 5cd6ff11b5
198 changed files with 9715 additions and 6664 deletions
+59
View File
@@ -0,0 +1,59 @@
<?php
namespace App\Observers;
use App\Models\Division;
use App\Services\App\Cache\DivisionCacheService;
class DivisionObserver
{
private DivisionCacheService $divisionCacheService;
public function __construct()
{
$this->divisionCacheService = app(DivisionCacheService::class);
}
/**
* Handle the Division "created" event.
*/
public function created(Division $division): void
{
$this->divisionCacheService->clearAllCacheByModel();
}
/**
* Handle the Division "updated" event.
*/
public function updated(Division $division): void
{
$this->divisionCacheService->clearCache($division);
$this->divisionCacheService->clearAllCacheByModel();
}
/**
* Handle the Division "deleted" event.
*/
public function deleted(Division $division): void
{
$this->divisionCacheService->clearCache($division);
$this->divisionCacheService->clearAllCacheByModel();
}
/**
* Handle the Division "restored" event.
*/
public function restored(Division $division): void
{
$this->divisionCacheService->clearAllCacheByModel();
}
/**
* Handle the Division "force deleted" event.
*/
public function forceDeleted(Division $division): void
{
$this->divisionCacheService->clearCache($division);
$this->divisionCacheService->clearAllCacheByModel();
}
}