As mentioned, how to make the admin route open only to the administrator account? Ordinary logged-in users cannot access the backend. Thanks.
As mentioned, how to make the admin route open only to the administrator account? Ordinary logged-in users cannot access the backend. Thanks.
//Background routing
Route::group(['prefix' => 'admin', 'middleware' => 'admin.login'], function () {
<code>Route::get('index', function () { echo "admin/index"; }); //后台文章管理界面 Route::resource('article', 'ArticleController');</code>
});
The admin.login middleware is defined by myself and then added to Kernel.php
It can be achieved by adding middleware, subject to limitations.
In routing, adding middleware can achieve