Closed rogue780 closed 9 years ago
Really appreciate your work on this @rogue780.
Couple of things - create/update goes via the fill() method, this then calls setAttribute which uses the $key to set $this->attributes[$key]. That's what you should be updating/overloading - that way said logic is left in a separate method and doesn't get in the way of users overloading their create methods.
If you can make those changes and write the appropriate tests - happy to then merge in the code.
@kirkbushell I've updated the PR. I'm not very good at unit tests so if I botched that part up, let me know.
Hi @rogue780. On further note - eloquence already deals with the setAttribute method. I'll look at this a bit more myself - overloading fill() is not what I meant :)
Some code of mine failed when using the CamelCaseModel because I was using Model::create() instead of assigning each attribute.
This code will make it so attributes are properly translated when using create() with the CamelCaseModel trait.