'How to create a patient table from an existing role table in laravel
So i am lost and i hope someone can help me.
I have a User model that has a name and email fields. A Role User model that has a many to many relationship where a user_id has a role_id A Role model that has the role name.
My question is how can i create a new patient table where the role is patient from the existing tables?
any help would be much APPRECIATED!
Solution 1:[1]
You could just bin this too and use https://spatie.be/docs/laravel-permission/v5/introduction
This is all done for you. Create a permission or role give the user the role and all is done for you. Just use the associations set up in the package. Way more powerful than creating from scratch. All the heavy lifting is done and much more powerful for your application.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 |
