php - Laravel show page according to authentication status -


is there way can configuration in routes.php:

route::get('/', function(){ if ( auth::check() === false )   {    return homecontroller@guest<--- specific controller's method  }   else   {    return homecontroller@logged <--- specific controller's method  }  }); 

i don't want use redirect since want keep mysite.com/ main address.

of course can directly in route @ferticidios answer or have 1 controller method @maytham suggests. can asked for:

route::get('/', function(){     if ( auth::check() === false )      {         return app::make('homecontroller')->callaction('guest', array());     }      else      {         return app::make('homecontroller')->callaction('logged', array());     }  }); 

Comments

Popular posts from this blog

java - Plugin org.apache.maven.plugins:maven-install-plugin:2.4 or one of its dependencies could not be resolved -

Round ImageView Android -

How can I utilize Yahoo Weather API in android -