Search code examples
phpmysqllaraveladminregistration

Admin create Users in Laravel


I have a admin panel called 'master'. Using this panel, I want to register new users with different roles.

For example, I want to register two new users, named 'John' and 'Alex' with their roles as 'Sales' and 'HR', respectively.

Is it possible in Laravel 5.8, if so, how?

My user registration form in master looks something like this, click here to see the image


Solution

  • What is the exact issue you're getting as your problem is not specific. It seems like you are trying to create 2 users with the given form. Below steps you can follow:

    1. provide a drop down for roles in UI with values like "sales", "HR".
    2. You have to create tables for roles and users through migrations.
    3. Get request in controller and use models to insert into tables.