Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Activity Facade #1372

Merged
merged 4 commits into from
Feb 10, 2025
Merged

Activity Facade #1372

merged 4 commits into from
Feb 10, 2025

Conversation

stevebauman
Copy link
Contributor

@stevebauman stevebauman commented Feb 6, 2025

Description

This PR adds a new Activity facade for those who prefer it to global helpers.

There's existing facades for other utilities in this library already so it feels out of place that there isn't one already for creating an actual activity.

Usage

All the typical methods can be used as you'd expect:

use Spatie\Activitylog\Facades\Activity;

Activity::on($team)
   ->causedBy($user)
   ->event('sent-invitation')
   ->withProperties(['email' => '[email protected]'])
   ->log('User sent an invitation to an email address.');

Let me know your thoughts!

@freekmurze freekmurze merged commit 4239090 into spatie:main Feb 10, 2025
17 checks passed
@freekmurze
Copy link
Member

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants