Remove specific routes from middleware in SLIM
<p>I added middleware to my project</p>

<pre><code>//Initiate a Slim instance
$app = new \Slim\Slim();

//Add Middleware for authentication
$app-&gt;add(new ExampleMiddleware();
</code></pre>

<p>but, i want to leave some routes out of the middleware.
Here is my class:</p>

<pre><code>class ExampleMiddleware extends Slim\Middleware {
    public function __construct() { 
    //Define the urls that you want to exclude from Authentication
    $this-&gt;whiteList =['/'];//This does not work
}


public function call(){
 $res = User::authenticate($token); //Verify user

    if ($res){

        $this-&gt;next-&gt;call();//Continue to execute the request    
    } else {
        $this-&gt;app-&gt;response-&gt;body(json_encode(['error' =&gt; 'denied']));
    }        
}
}

//Sample Route which returns a user from DB using Laravel
$app-&gt;get('/', function () use ($app) {
$u = User::find(22078);
$app-&gt;response-&gt;body($u-&gt;toJson());
});
</code></pre>

<p>How can i leave the for example the  '/' route out of the authentication process?</p>

<p>Thanks</p>