Skip to content

fix: GeneaLabs/laravel-model-caching issue #448 #449

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

Merged
merged 1 commit into from
Mar 27, 2023

Conversation

jason-klein
Copy link
Contributor

This patch resolved an error we were receiving when using attach() or detach() on a Model relationship after upgrading to Laravel 10. This patch seems to fix a bug introduced by this commit: mikebronner/laravel-pivot-events@862371f

Relevant package versions:

laravel/framework: 10.4.1
genealabs/laravel-model-caching: 0.13.3
genealabs/laravel-pivot-events: 10.0.1

We were receiving the same error described in issue #448:

checkCooldownAndFlushAfterPersisting(): Argument # 2 ($relationship) must be of type string, array given, called in /var/www/html/vendor/genealabs/laravel-model-caching/src/Traits/ModelCaching.php on line 83

Prior to this patch, I confirmed Argument # 2 ($relationship) contained an array of record IDs. After this patch, I confirmed Argument # 2 ($relationship) contained a string with the relationship name. The Model cache appears to be updated as expected after attach() and detach() events.

I was unable to run the package's test suite. This package seems to require Laravel Nova? I do not have a Nova license. Running composer install within this package directory prompts for a Laravel Nova login.

checkCooldownAndFlushAfterPersisting(): Argument mikebronner#2 ($relationship) must be of type string, array given, called in /var/www/html/vendor/genealabs/laravel-model-caching/src/Traits/ModelCaching.php on line 83
@mikebronner mikebronner merged commit 631bb7f into mikebronner:master Mar 27, 2023
JamesPJ added a commit to JamesPJ/laravel-model-caching that referenced this pull request Dec 12, 2024
JamesPJ added a commit to JamesPJ/laravel-model-caching that referenced this pull request Dec 12, 2024
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