Hi!
I'm creating an app where I'm using a User model that represents Hotels. The columns for these have some info about the hotels such as star number.. number of rooms etc. So, every hotel has an account where there will be some information in a dashboard. I would like to have a master account where I can see information about all the registered hotels. However for this master account I just need to store a username and a password.
I'm confused whether I should create another database table with a single row that is the username and password for this master account, or should I create another column with the admin rights on the hotels table (I have the feeling that this method is not the right one).. How could I go about to create the admin account using good practices?
I hope I made myself clear. Thanks for reading.
A simple way to handle this is with roles and/or permissions.
There are some packages available to streamline this process for you, like Entrust.
Also consider a package like Eloquence, so you can use the Metable Trait (or build your own). That way, you aren't storing tons of data in your users table.
Of course, whatever works for you, just throwing out some options :)
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community