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\Faculty;
use App\Services\App\Cache\FacultyCacheService;
class FacultyObserver
{
private FacultyCacheService $facultyCacheService;
public function __construct()
{
$this->facultyCacheService = app(FacultyCacheService::class);
}
/**
* Handle the Faculty "created" event.
*/
public function created(Faculty $faculty): void
{
$this->facultyCacheService->clearAllCacheByModel();
}
/**
* Handle the Faculty "updated" event.
*/
public function updated(Faculty $faculty): void
{
$this->facultyCacheService->clearCache($faculty);
$this->facultyCacheService->clearAllCacheByModel();
}
/**
* Handle the Faculty "deleted" event.
*/
public function deleted(Faculty $faculty): void
{
$this->facultyCacheService->clearCache($faculty);
$this->facultyCacheService->clearAllCacheByModel();
}
/**
* Handle the Faculty "restored" event.
*/
public function restored(Faculty $faculty): void
{
$this->facultyCacheService->clearAllCacheByModel();
}
/**
* Handle the Faculty "force deleted" event.
*/
public function forceDeleted(Faculty $faculty): void
{
$this->facultyCacheService->clearCache($faculty);
$this->facultyCacheService->clearAllCacheByModel();
}
}