What strategy should I follow for role assigning for user in my app?
Hello,
I am creating an e-commerce website. The website will have three roles for user (admin, seller, buyer). I want suggestion from you people how I should assign the roles for them?
I have a users table and roles table. I created a registration form. Is it will be a good option to put a radion button in registration form so user can select their role at the time of sign up? Your views about this will be helpful.
I would also suggest you look at some packages on GitHub on how things are done in e-commerce, at least review the code because there's a lot to an e-commerce site.
Also I would highly recommend using a good well maintained package for this instead of Reinventing the wheel.
As you have to deal with payments charges and things of that nature.
@jlrdw As I am new to laravel so didn't know about that much. Someone suggested "spatie" for permissions. Don't know how it will work and what things are possible with it.
I will definitely do some search about other packages. Any specific package you recommend?
As pointed out before, you will learn a lot from other packages. And take a look at several of the series here at laracast, check out this one about building a form, there is a section about roles there too (if i'm not mistaken): https://laracasts.com/series/lets-build-a-forum-with-laravel