Skip to content

How to protect mailbook in production #51

Answered by Xammie
nezaboravi asked this question in Q&A
Discussion options

You must be logged in to vote

Similar to my answer on #50. This can be achieved with the following config in config/mailbook.php

'middlewares' => [
    'web',
    'auth',
    Xammie\Mailbook\Http\Middlewares\RollbackDatabase::class,
],

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.

'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 …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@nezaboravi
Comment options

Answer selected by Xammie
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants