i have two guards admin
and users
and here users
are of different type
-users
-BD
-SPOC
-RECRUITOR
-LEADERSHIP
now I have some controllers which i want both admin and user to access.if anyone of them is logged in.but i dont want to allow anybody else to access it without login.
This is my controller
class AdminController extends Controller {
protected $redirectTo = '/admin/dashboard';
protected $redirectAfterLogout = '/admin/login';
public function __construct()
{
$this->middleware('auth:admin');
}
}
in the above controller if i use middleware -auth:admin then only admin will be able to access it and if i use middleware-auth only then i will take the user to user login screen.i want if anybody between admin or user of type leadership is logged in then they are able to access this controller.
i want or condition in middleware to check either this or that ie middleware between auth or auth:admin not both
how do i do this?
i m using laravel
.i m new to this please help