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

fix: RecordCustomAudit listener #963

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

Pr3d4dor
Copy link

This pull request fixes this problem:

OwenIt\Auditing\Listeners\RecordCustomAudit::handle(): Argument #1 ($model) must be of type OwenIt\Auditing\Contracts\Auditable, OwenIt\Auditing\Events\AuditCustom given, called in /mnt/c/Users/bine/Documents/mapos-laravel/vendor/laravel/framework/src/Illuminate/Events/Dispatcher.php on line 478 

@willpower232
Copy link
Contributor

I'm assuming that fixing these tests also makes sense as well as correcting the listener

@Pr3d4dor
Copy link
Author

Pr3d4dor commented Aug 19, 2024

@willpower232 There is a strange behavior, maybe there is a bug in the Laravel core.

This does not work:

Event::dispatch(AuditCustom::class, [$this]);

But this works:

Event::dispatch(new AuditCustom($this));

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