title: Laravel | how to change route if user is not authenticated
body: <p>I don't know If this is possible with laravel or what is the best way to achieve it, i wan't if user click to like post or add to favorites and he is not authenticated to showing login form, </p>
  
  <p>I want every visitor to have access to all posts, i have used before <code>if(auth::check())</code> in my view to hide or display the buttons (like &amp; favorite) if user authenticated, but i don't like this way. i want to display the buttons to all visitors but when a Unauthenticated user click on like button redirecting to login page.
  I tried to add this method to my routes but seems not working</p>
  
  <pre><code>if (Auth:check()){
    Route::post('/favorite/{post}', 'SiteController@favorite');
    Route::post('/unfavorite/{post}', 'SiteController@unFavorite');
  
    Route::post('/like/{post}', 'SiteController@like');
    Route::post('/update/{post}', 'SiteController@update');
    Route::post('/unlike/{post}', 'SiteController@unLike');
  
  } else {
  
    Route::get('/login', ['as' =&gt; 'login', 'uses' =&gt; 'Auth\LoginController@showLoginForm']);
  </code></pre>