District Core Developer DocsDistrict Core Developer Docs
Developers
Boilerplate
Modules
Bitbucket
Developers
Boilerplate
Modules
Bitbucket
  • Modules

    • ABN
    • ActivityLog
    • AnalyticsApi
    • ApiConnector
    • BlockApi
    • CategoryApi
    • CloneApi
    • CommentApi
    • ContentApi
    • Core
    • Documents
    • EmbedApi
    • Event
    • ExportApi
    • FeatureApi
    • FormApi
    • GTM
    • GalleryApi
    • HelpApi
    • Hotspot
    • IdeaSurvey
    • ImportApi
    • InteractionsApi
    • Intercom
    • MailApi
    • MapApi
    • MapSurvey
    • MediaApi
    • MenuApi
    • MetaTagApi
    • NlpApi
    • NotificationApi
    • Page
    • ParentableContent
    • PaymentApi
    • PermissionsApi
    • Postcode
    • ReCaptcha
    • Redirects
    • Renderer
    • ReportApi
    • RestrictionApi
    • RevisionApi
    • SearchApi
    • Settings
    • ShareableApi
    • Slack
    • SlugApi
    • SubscribableApi
    • Survey
    • Team
    • TenantApi
    • TestApi
    • ThemeApi
    • Timeline
    • TranslationApi
    • Update
    • Users
    • VisualisationApi
    • WorkflowApi
    • Wysiwyg

ActivityLog Module

This package provides a trait which can be used to add activitylog functionality to an entity.

It uses spatie/laravel-activitylog under the hood, but you can use the trait provided by this module directly.

Example

    use Modules\ActivityLog\Traits\ActivityLogTrait;
    use Illuminate\Database\Eloquent\Model;

    public class Example extends Model {
        use ActivityLogTrait;

        public function docs() {
            // You can now get the activity log with
            $activities = $this->activities();

            // You can get the "action"
            // and "causer" from the activity
            $user = $activities->first()->causer;
            $reason = $activities->first()->description;
        }
    }

Edit this page
Prev
ABN
Next
AnalyticsApi