<div class="last-posts">
<h2>Последние сообщения</h2>
<ul>
<?php $posts = get_posts('numberposts=3');
foreach($posts as $post) { ?>
<li><a href="<?php the_permalink(); ?>" title="<?php the_title(); ?>"><?php the_title(); ?></a>
<?php if ( has_post_thumbnail() ) the_post_thumbnail(); ?>
<?php the_excerpt(); ?>
</li>
<?php } ?>
</ul>
<div>
Route::filter('admin', function(){
if(Auth::check()){
//Проверяем является ли юзер админом
if(Auth::User()->role != 'admin'){
return Redirect::to('/');
}
}else{
return Redirect::guest('auth/login');
}
});
Route::group(['prefix' => 'admin', 'before' => 'admin'], function(){
.........
});