You must use "middleware" https://laravel.com/docs/5.7/middleware
Nov 23, 2018
3
Level 2
Require login for certain views?
Hi there,
I am building a small cms like application as a personal project and I'm wondering how can I get certain views to be 'authenicated' or password protected? For example, I ran the auth command and I have the dashboard routing to '/admin'.
I want to create a view with a form to post events so that route is /admin/events
If I was to hit that view directly with incognito mode it'll still load so I want it where if I someone was to access it by random it'll redirect them to the /login url to login. I do have plans for an events section as well. Let me know if there's more clarification needed.
Level 2
Please or to participate in this conversation.