fix bugs and deletes unnecessary files

This commit is contained in:
F4ilji
2025-04-04 22:59:34 +05:00
parent b6fb523aaa
commit 8aeef476ae
25 changed files with 314 additions and 420 deletions
+14 -9
View File
@@ -17,16 +17,21 @@ class PersonController extends Controller
{
$cacheKey = CacheKeys::USER_PREFIX->value . md5($slug);
[$person, $seo] = Cache::remember($cacheKey, now()->addHours(24), function () use ($slug) {
$person = User::query()->with(['userDetail', 'departments_work.faculty', 'departments_teach.faculty', 'divisions', 'faculties'])
$personData = Cache::remember(
CacheKeys::USER_PREFIX->value . $slug,
now()->addHours(24),
fn() => User::with(['userDetail', 'departments_work.faculty', 'departments_teach.faculty', 'divisions', 'faculties'])
->where('slug', $slug)
->firstOrFail();
$seo = $this->seoPageProvider->getSeoForModel($person);
return [
new ClientFullInfoPersonResource($person),
$seo
];
});
->firstOrFail()
);
$seo = Cache::remember(
CacheKeys::USER_PREFIX->value . 'seo_' . $slug,
now()->addHours(24),
fn() => $this->seoPageProvider->getSeoForModel($personData)
);
$person = new ClientFullInfoPersonResource($personData);