-
Is this kind of a veneer that acts like it's in the DB? or should I actually be seeing this value when accessing my database? I created a migration for the hash_id column and gave it a default of empty because the hash isn't written until the second save, but when I access the database directly after the fact I still just see the default value. Accessing the value via one of the laravel-model-hashid helper functions in my controller however, I can see the correct hash id under that column. Apologies if i'm just being stupid. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Hi James, HashID generation can be all on-the-fly, you don't need to save HashIDs to the database. But if you want to save HashIDs to your database for your purposes you can add This feature is already documented and you can read more about that here |
Beta Was this translation helpful? Give feedback.
Hi James,
HashID generation can be all on-the-fly, you don't need to save HashIDs to the database.
You have all the routing/binding functionality by just adding
HasHashIdRouting
trait to your model.But if you want to save HashIDs to your database for your purposes you can add
SavesHashId
trait to your model as well.This feature is already documented and you can read more about that here