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

performedOn($model) does not call the tapActivity() for the corresponding model #1022

Closed
FrancisMawn opened this issue Mar 8, 2022 · 2 comments

Comments

@FrancisMawn
Copy link
Contributor

Describe the bug
Hi. I came across this issue while writing my tests. I'm not sure if that's intentional or not, but to me it seems like an oversight...? If you manually generate an activity and set its subject, the tapActivity() method on that subject model will not get called.

To Reproduce
Add a tapActivity() method on the user model.
Run the following code:

$user = User::factory()->create();
$activity = activity()->performedOn($user)->log('Some activity');

Expected behavior
I would expect the the tapActivity() handler to get called during the creation of the activity.

Versions (please complete the following information)

  • PHP: 8.0
  • Database: Mysql 8
  • Laravel: 9.2
  • Package: 4.4
@Gummibeer
Copy link
Collaborator

Feel free to provide a PR to improve that behavior.

@AlexVanderbist
Copy link
Member

Thanks!

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

No branches or pull requests

3 participants