I always think in this way:
- how many elements are there? If more than 3 i would go with db
- is it application for myself or a client? If it's for a client I would go with db (little crud interace in admin so he can add/remove/modify the categories himself even after the end of development).
Things like categories are the data that come from the customers - if they come from customers give the customers the control what is inside (and save yourself the time to
change source code). Like this they can provide the excel/cvs file that you can use for seeding the db with initial records (and without changing the source code). It's also easier
later to make different tricks in SQL (joins) if the categories are in db.
IMHO the only place where I would use the hardcoded hash/array is some (2-3) multi values attributes like user roles (of course if they are static).