Features

Activity & notifications

Externa records domain and auth events with Spatie Activitylog, exposes an Activity Log admin page (and an AI query tool), and delivers file job outcomes through database notifications in the sidebar bell.

Related

Dashboard widgets that read activity: Dashboard. File jobs that emit notifications: File manager. Realtime bell / presence: Reverb & Echo. AI logging helpers: AI assistant model.

Spatie Activitylog

ItemDetail
Package modelSpatie\Activitylog\Models\Activity
Configconfig/activitylog.php
Env toggleACTIVITYLOG_ENABLED
Retentionclean_after_days = 365
Default log namedefault
CleanupSchedule::command('activitylog:clean')->daily()

LogsApplicationActivity

Trait: App\Concerns\LogsApplicationActivity (wraps Spatie LogsActivity).

Options: logAll(), logOnlyDirty(), dontLogEmptyChanges(), useLogName('default').

Used on: User, UserGroup, Collection, CollectionField, CollectionItem, File, FileVersion, FileUpload.

Item editors surface a compact activity strip (last update + revisions/activity links). Field-level history remains in Item History, not Spatie attribute diffs.

Auth login / logout / failed

Registered in AppServiceProvider::registerAuthActivityListeners():

EventLog nameActivity eventDescription / notes
Illuminate\Auth\Events\LoginauthloginUser logged in; also updates last_login_at / last_login_ip
LogoutauthlogoutUser logged out
FailedauthfailedFailed login attempt; causedByAnonymous(), property identifier

AI activity

App\Ai\Support\AiActivityLogger writes log_name=ai with events ai_prompt, ai_response, ai_tool, ai_mutation.

Activity Log UI

ItemDetail
ControllerApp\Http\Controllers\Admin\ActivityLogController
RouteGET /activity-logs (activity-logs.index)
Middlewareauth, verified, permission:can-show-activity-logs
Permissioncan-show-activity-logs
Pageresources/js/pages/admin/activity-logs/index.tsx

Filters: search, user_id, event, log_name, date_from, date_to, optional subject_type + subject_id (used by the item form Activity link).

Filterable events:

created | updated | deleted | restored
login | logout | failed
ai_prompt | ai_response | ai_tool | ai_mutation

AI QueryActivityLogs

ItemDetail
ToolApp\Ai\Tools\QueryActivityLogs
Gatecan-show-activity-logs
LimitsDefault 25, max 50
DatesYYYY-MM-DD only
EventsSame set as the UI filters

Registered on AppAssistant when the user has can-show-activity-logs.

Notifications (file jobs)

All use trait BroadcastsWithDatabase: via(['database']), plus broadcast when BROADCAST_CONNECTION is not log/null.

Classdata.typeEmitted from
App\Notifications\FileZipReadyNotificationfile_zip_readyPrepareFilesZipJob
App\Notifications\FileZipFailedNotificationfile_zip_failedPrepareFilesZipJob
App\Notifications\FileDuplicationCompletedNotificationfile_duplication_completedDuplicateFilesJob
App\Notifications\FileDuplicationFailedNotificationfile_duplication_failedDuplicateFilesJob

Zip-ready notifications point at download route files.zips.download.

Realtime delivery (Echo private channel App.Models.User.{id}) is documented in Reverb & Echo. When BROADCAST_CONNECTION is log/null, the sidebar bell keeps its 60s unread poll; with Reverb enabled there is no periodic poll — Echo .notification() updates the badge.

Bell API

ItemDetail
ControllerApp\Http\Controllers\NotificationController
Routesroutes/web.php
Middlewareauth + verified only — no activity-log permission
UINotificationsBell + NotificationsDrawer in the sidebar
Clientresources/js/lib/notifications-api.ts

| Method | Path | Name | Behavior | | --- | --- | --- | | GET | /notifications | notifications.index | Paginate 20 | | GET | /notifications/unread-count | notifications.unread-count | Unread count | | POST | /notifications/read | notifications.read | Mark read |

There is no dedicated notification permission in PermissionEnum; any authenticated verified user can use the bell API for their own notifications.

Permissions summary

SurfacePermission
Activity Log page + QueryActivityLogscan-show-activity-logs
Notifications bell / APIAuthenticated + verified (no enum gate)

Source map

ConcernLocation
Activity controllerapp/Http/Controllers/Admin/ActivityLogController.php
Logging traitapp/Concerns/LogsApplicationActivity.php
Auth listenersAppServiceProvider::registerAuthActivityListeners
AI query toolapp/Ai/Tools/QueryActivityLogs.php
Notificationsapp/Notifications/FileZip*Notification.php, FileDuplication*Notification.php
Bell APIapp/Http/Controllers/NotificationController.php
Previous
AI imports & sync