Skip to content

Laravel 5.5 Support #186

Open
Open

Description

@austenc

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

Activity

  1. austenc commented on Aug 31, 2017

    @austenc
    Author

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

    PR: laravel/framework#20903

  2. austenc commented on Sep 1, 2017

    @austenc
    Author

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

  3. czim commented on Sep 2, 2017

    @czim

    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.

  4. austenc commented on Sep 4, 2017

    @austenc
    Author

    @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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions