PlatformAuditLog Model
The PlatformAuditLog model records all cross-tenant actions performed by platform managers.
Table: platform_audit_logs
Model: App\Models\PlatformAuditLog
Database Schema
| Column | Type | Nullable | Description |
|---|---|---|---|
id | bigint unsigned | No | Primary key |
platform_manager_user_id | bigint unsigned | No | Acting user |
target_organization_id | bigint unsigned | No | Target organization |
action | string | No | create, update, delete, view |
target_entity_type | string | No | Model affected |
target_entity_id | int | No | Record ID |
before_state | JSON | Yes | Values before change |
after_state | JSON | Yes | Values after change |
reason | string | Yes | Reason for action |
ip_address | string | Yes | Request IP |
user_agent | string | Yes | Request user agent |
created_at | datetime | No | |
updated_at | datetime | No |
Relationships
$log->platformManager() → User
$log->targetOrganization() → Organization
Usage Notes
- Platform audit logs are not tenant-scoped.
- They are used for compliance, debugging, and security auditing.
before_stateandafter_statestore snapshots of the affected record.
Related Documentation
- Platform Management Memory
- User Model (
App\Models\User)