riad jabel
riad jabel

Reputation: 19

User and admin role in laravel 5.3

In my laravel project, I want some admin and user role. I want to make user login in different routes after login. And also for admin also. How should I do it?

Upvotes: 1

Views: 2345

Answers (2)

AddWeb Solution Pvt Ltd
AddWeb Solution Pvt Ltd

Reputation: 21691

You can try laravel 5.3 boilerplate. It comes with a full featured access control system out of the box with an easy to learn API and is built on a Twitter Bootstrap foundation with a front and backend architecture.

Upvotes: 0

Townim Faisal
Townim Faisal

Reputation: 325

You should first make 3 table in your database; user, role and user_role. user_role table has many to many relationship. Then you will make a middleware that checks your role checks when login. In your route, you use that middleware in login's post.

See details about middle ware in laravel 5.3 documentation. https://www.laravel.com/docs/5.3/middleware

Upvotes: 2

Related Questions