-
Notifications
You must be signed in to change notification settings - Fork 9
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
Issue in the file-handling when using loadCount() on model #19
Comments
Not sure if this helps but the $data variable causing the error in StorableFileFactory.php is is an instance of "Czim\Paperclip\Attachment\Attachment" I serialized the $data variable before reaching the is_string() check in StorableFileFactory line 98 to see if it would work and it does. It works with all model->loadCount() as well as model->withCount(). Might not be the solution you want but just an idea.
All the below iterations work with the fix above.
|
I've ran into a situation where I cannot use loadCount() on a model when the model is using laravel-paperclip.
The error is pasted below and comes from this package.
The above results in the following error:
I have two models, Project and Expedition, that use Laravel-Paperclip. I tried loading counts of other relations that do not use laravel-paperclip and they don't work either. Example:
If I use a model that doesn't use Laravel-Paperclip, the loadCount() works as expected.
Edit: Querying withCount() works as expected. I use loadCount() in this situation because it's a route using model binding.
Any idea on how to fix this?
Oh... an example of my Project model... real simple:
The text was updated successfully, but these errors were encountered: