adding UserDetailObserver and reorderable records feature

This commit is contained in:
F4ilji
2025-05-13 15:01:03 +05:00
parent c3c468c11a
commit 0314febda2
14 changed files with 165 additions and 273 deletions
@@ -38,7 +38,15 @@ class ClientDivisionController extends Controller
});
$divisionData = Cache::remember(CacheKeys::DIVISION_PREFIX->value . $slug, now()->addDay(), function () use ($slug) {
return Division::with(['workers.userDetail', 'seo'])->where('is_active', true)->where('slug', $slug)->firstOrFail();
return Division::query()
->with([
'workers' => fn ($query) => $query->orderBy('sort', 'asc'),
'workers.userDetail',
'seo'
])
->where('is_active', true)
->where('slug', $slug)
->firstOrFail();
});
$seo = $this->seoPageProvider->getSeoForModel($divisionData);