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

Laravel 5.5 Support #186

Open
austenc opened this issue Aug 31, 2017 · 4 comments
Open

Laravel 5.5 Support #186

austenc opened this issue Aug 31, 2017 · 4 comments

Comments

@austenc
Copy link

austenc commented Aug 31, 2017

This change is not backwards compatible with this package. This is due to the override of the getAttributes() model method. If the attribute values aren't strings, the query builder can't bind them properly and you get an "Object could not be converted to string" message.

This looks like it's been in the EloquentTrait for quite a long time, since 86fd1db. What does overriding that method actually provide though? Doesn't the accessor for the field still exist?

Edit: Sorry I didn't bring this issue up in the laravel stapler repo, but this is the repo that contains the EloquentTrait class

@austenc
Copy link
Author

austenc commented Aug 31, 2017

I've also opened an issue related to this here: laravel/framework#20902

PR: laravel/framework#20903

@austenc
Copy link
Author

austenc commented Sep 1, 2017

Looks like this needs to be fixed in the package, removing the getAttributes() method override will do it.

@czim
Copy link

czim commented Sep 2, 2017

I solved this problem in my own 'Stapler copycat' package this way:
czim/laravel-paperclip@515a66b

So far, so good, but if anyone has a nicer fix, I'd love to hear it.

@austenc
Copy link
Author

austenc commented Sep 4, 2017

@czim Solid fix, thank you for sharing!

I ended up using my own trait (which uses the EloquentTrait) to override the getAttributes method (and just return the parent version), but yours seems like a better solution!

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

No branches or pull requests

2 participants