예제 #1
0
 public function showCategory($slug)
 {
     $categories = Category::all();
     $category = Category::whereSlug($slug)->first();
     $posts = Post::isPublished()->where('category_id', $category->id)->paginate(10);
     return view('blog::category.show')->withPageTitle($category->name)->withPosts($posts)->withCategory($category)->withCategories($categories)->withActiveCategory($category->id);
 }
예제 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $posts = Post::orderBy('created_at', 'desc')->paginate(10);
     return view('blog::admin.index')->withPosts($posts)->withCategories(Category::all())->withOptionRssName(Option::get('rss_name'))->withOptionRssNumber(Option::get('rss_number'));
 }