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ıt
  • contentType → ActivityLogContentType
  • action → ActivityLogActionType
  • description — Opsiyonel açıklama
  • details — “Username/Email: user@example.com

Job

CreateActivityLogJob — Queue’da async çalışır. Sync beklemek gerekmez; log yazmak main akışı yavaşlatmaz.