How to protect mailbook in production #51
Answered
by
Xammie
nezaboravi
asked this question in
Q&A
-
Tried to set middleware, but somehow it skips it, and route is exposed on web. |
Beta Was this translation helpful? Give feedback.
Answered by
Xammie
Apr 18, 2023
Replies: 1 comment 1 reply
-
Similar to my answer on #50. This can be achieved with the following config in 'middlewares' => [
'web',
'auth',
Xammie\Mailbook\Http\Middlewares\RollbackDatabase::class,
], The You can also add another custom middleware if you only want admin users to access mailbook. 'middlewares' => [
'web',
'auth',
App\Http\Middlewares\AdminMiddleware::class, // middleware that would only allow users with the role of admin
Xammie\Mailbook\Http\Middlewares\RollbackDatabase::class,
], If this does not help, please give me some more context in the form of code or screenshots of what you are trying to do. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
Xammie
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Similar to my answer on #50. This can be achieved with the following config in
config/mailbook.php
The
auth
middleware would make sure only logged in users are able to see/mailbook
.You can also add another custom middleware if you only want admin users to access mailbook.
If this does not help, please give me some more context in the form of code or screenshots of …