Proje: Okul Platform · Hub: Okul Platform — Domain
ActivityLogService
app/Services/ActivityLogService.php
Dispatch Yöntemi (Statik)
Log her zaman async (queue job olarak) oluşturulur:
ActivityLogService::dispatch(
user: $user,
contentId: $school->id,
contentType: ActivityLogContentType::SCHOOLS,
actionType: ActivityLogActionType::EDIT_SCHOOL,
description: 'Okul düzenlendi',
);Veri
ipAddress— request()→ip()userAgent— request()→userAgent()userId— Hangi kullanıcıcontentId— Hangi kayıtcontentType→ ActivityLogContentTypeaction→ ActivityLogActionTypedescription— Opsiyonel açıklamadetails— “Username/Email: user@example.com”
Job
CreateActivityLogJob — Queue’da async çalışır.
Sync beklemek gerekmez; log yazmak main akışı yavaşlatmaz.
Related
- api-activity-log-system — ActivityLogActionType + ContentType enum’ları
- api-queue-jobs — Async job sistemi