User models vs methods

I want to add custom methods for customer role. For ex:

  • cart()
  • addresses()
  • favorites()

Which one should I use?
User models or methods?

Also what the access differences? For ex:

userMethods: kirby()->user()->cart();
userModels: kirby()->user()->cart();

Right? Just a role difference? Little confused…


For a particular role, use a model. The difference is that methods apply to all users whereas models are role specific. Also, with models you can override native methods, with methods you can’t.

All right, then there’s a problem with userModels, I’ll create an issue on GitHub.

This has already been fixed on the dev branch, no need to create a new issue.

Great news! :+1: Thank you