S
S
Space2018-02-01 01:11:52
Laravel
Space, 2018-02-01 01:11:52

How to add validation to every page in laravel?

You need to disable the Debugger if Auth::user()-role != 'superadmin' and the debug parameter.
It turns out like this:

if(Auth::user()-role != 'superadmin' || \Request::get('debug') != 'boss')
  \Debugbar::disable();

But I need the check to be on all pages, you can put it in the sidebar, of course, but this is generally wrong.
I know that there are middleware, but I don’t understand how to use them if I don’t need to deny access to the page. How is this solved?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Stanislav Pochepko, 2018-02-01
@DJZT

AppServiceProvider in boot method

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question