Skip to content

Conversation

@lindyhopchris
Copy link
Member

When this package was first being developed, the JSON API spec recommended dash-case (e.g. created-at) for resource member names. This recommendation has since changed, and camel-case is now recommended (e.g. createdAt).

This PR goes through the package an amends it to follow the most up-to-date recommendation of camel-case. There are actually very few implications on the package. These are:

  • For the SoftDeletesModel trait, the default soft deletes field is now the camel-case version of the model column, not the dash case. Developers can easily continue to use dash-case by setting the softDeleteField on their adapters.
  • The stub for the Eloquent schema now uses camel-case for createdAt and updatedAt. If the developer is using dash-case, it is exceptionally simple to amend those two field names once the resource is generated.

Because of the soft deletes change, this is a breaking change so will have to be released in the next major version (3.0).

Closes #393

@lindyhopchris lindyhopchris merged commit 239db6e into develop Jul 23, 2020
@lindyhopchris lindyhopchris deleted the camelize branch July 23, 2020 09:05
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.

Camel-case member names by default

2 participants