Table design three types of users (admin, company, and student).
I'm trying to create a system that has three types of users (admin, company, and student).
so I have a student, company, and admin table.
my application case,
after the admin adds student and company data. students or companies can log in using email and password without having to register.
How do I retrieve student or company data from the table and make it a user name and password for the login?
what is the design of the login table?and relation?
A user is a user regrdless of type so you should only have one users table. Then you create a roles table and create your roles there (admin, company and student).
Then depending on if a user can have multiple roles or not you add the role_id to the users table or you create a role_users pivot table with the user_id and the role_id.
An authorization implementation to determine what the logged in person with role can or cannot do
Protection of URL and parameters, checking that the logged in users id matches the id used in a query
Each application will require unique tweaks in RBAC, no two apps are exactly the same.
Query Scopes can be used to differentiate an admin from a user, and what data is shown in the query.
The out of box Authentication gives you everything you need no matter how many types of user.
You also set up authorization to determine who can and cannot do what.
i want to create table company and student because later student or company can edit their data.
and i want after admin add data student or company.student or company can login without register.
and i want to make coloumn on table student,email and password for login.it is possible?
or I have to make a separate table between student login and table for student data?
Laravel is very flexible so just Implement your custom RBAC however you think you need.
Just FYI, you can do everything you described with the built-in authentication and authorization.
But of course you are free to do it customized also.
If I understand correctly what you want to achieve, you can use Laravel Guard to allow different classes of users to authentication using different DB Tables.