Answer the question
In order to leave comments, you need to log in
What is the best way to access the admin panel in this case?
I am making a blog on the finished layout, and actually, as I understand it, there is no commenting system here. It's just that the owner of the blog throws out news through the admin panel, and users simply read them. Actually, there can be only one role on the site: Admin. So, I made a banal laravel registration / login, and I need only administrators to register and log in. That is, he may not be one, but there may be three of them, for example. And at any moment they can increase. And leaving registration open is not an option, because users will be able to register and gain access to the admin panel. Or I think to make it so that after the first user registers, the registration mechanism itself is disabled, and in the future the accounts of other administrators can be done by the main admin in the admin panel, and send passwords and logins to these admins? Well, the middleware will only let the AdminController into the controller if the user is logged in. Is it right? How to do it right?
Maybe change in RegisterController with
public function __construct()
{
$this->middleware('guest');
}
public function __construct()
{
$this->middleware('auth');
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question