Route::get('photos/popular', 'PhotoController@method');
$rootScope.$on('$routeChangeStart', function(event, next, current){
if(next.$$route.auth){
if(!User.AuthCheck()){
$location.path('/');
}
if(next.$$route.originalPath == '/'){
if(User.AuthCheck()){
$location.path(current.$$route.originalPath);
}
}
}
if(next.$$route.admin){
if(!User.checkAdmin()){
$location.path('/');
}
}
});