I'd like to make authentication for admin and user using the laravel 5.2 auth api, I've a users table in which I've define ENUM type role field for user and admin so I need to use only table but different views and routes for admin and user login.
I've successfully create a user auth by using following command.
php artisan make:auth
but I can't understand how to implement auth for admin.
before you answer keep in mind there is only one users table which have role field and different views for admin and user login. After successfully login user will redirect to home page and admin should redirect to admin/dashboard.
Thanks
You Can use https://github.com/romanbican/roles package ...
if ($user->is('admin')) { // you can pass an id or slug
// or alternatively $user->hasRole('admin')
}