How to pass multiple parameters to middleware with OR condition in Laravel 5.2 : <p>I am trying to set permission to access an action to two different user roles Admin, Normal_User as shown below.</p>

<pre><code>Route::group(['middleware' =&gt; ['role_check:Normal_User','role_check:Admin']], function() {
        Route::get('/user/{user_id}', array('uses' =&gt; 'UserController@showUserDashboard', 'as' =&gt; 'showUserDashboard'));
    });
</code></pre>

<p>This route can be accessed by either Admin or Normal_user. But in this middleware configuration, user is required to be both Admin and Normal_User. How can I add OR condition in middleware parameter passing? Or is there any other method to give permission?</p>

<p>The following is my middleware</p>

<pre><code>public function handle($request, Closure $next, $role)
    {
        if ($role != Auth::user()-&gt;user_role-&gt;role ) {
            if ($request-&gt;ajax() || $request-&gt;wantsJson()) {
                return response('Unauthorized.', 401);
            } else {
                return response('Unauthorized.', 401);
            }
        }
        return $next($request);
    }
</code></pre>

<p>Can anyone please reply?</p>
