title: Laravel middleware on a VueJS route
body: <p>I have a VueJS route in my SPA application. I would like to apply a Laravel Middleware to a route (the auth middleware, in this case).</p>
  
  <p>Actually, I have try this:</p>
  
  <p>app.js</p>
  
  <pre><code>const router = new VueRouter({
      mode: 'history',
      routes: [
          {
              path: '/',
              name: 'home',
              component: require('./views/Home').default,
          },
          {
              path: '/hello',
              name: 'hello',
              component: require('./views/Hello').default,
          },
      ],
  });
  </code></pre>
  
  <p>routes/web.php</p>
  
  <pre><code>Route::get('/hello', 'HomeController@home')-&gt;middleware('auth');
  Route::get('/{any}', 'FrontendController@index')-&gt;where('any', '.*');
  </code></pre>
  
  <p>In this code, I have try to link the <code>auth</code> middleware to the route <code>/hello</code>, but it don't work. What is the best way to do that ?</p>
  
  <p>Thanks.</p>