As the question asks, is it necessary to have a numeric (and presumably, integer) value for a model's id? Or is any unique identifier acceptable? For example, could I use a GUID string?
It can be any arbitrary string according to the docs:
ID
A special property of models, the id is an arbitrary string (integer id or UUID). If you set the id in the attributes hash, it will be copied onto the model as a direct property. Models can be retrieved by id from collections, and the id is used to generate model URLs by default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With