public function detail($id)
 {
     $article = Blog::with('user')->where('id', '=', $id)->first();
     if (!$article) {
         return 'MAKALE BULUNAMADI!';
     }
     return View::make('blog.detail', compact('article'));
 }
Exemplo n.º 2
0
 public function index()
 {
     $blogs = Blog::with('author')->orderBy('created_at', 'desc')->take(10)->get();
     $events = Events::with('author')->orderBy('created_at', 'desc')->take(8)->get();
     $groups = Group::with('author')->orderBy('created_at', 'desc')->take(8)->get();
     $photos = Photo::with('author')->orderBy('created_at', 'desc')->take(8)->get();
     return View::make('home.index')->with('blogs', $blogs)->with('events', $events)->with('groups', $groups)->with('photos', $photos);
 }
Exemplo n.º 3
0
 public function action_index()
 {
     // lets get our posts and eager load the
     // author
     $blogs = Blog::with('author')->order_by('created_at', 'desc')->take(10)->get();
     // show the home view, and include our
     // posts too
     //$posts->appends(array('a' => 'app'));
     return View::make('home.index')->with('blogs', $blogs);
 }
Exemplo n.º 4
0
 public function index()
 {
     //博客首页
     $blogs = Blog::with('author')->orderBy('created_at', 'desc')->paginate(20);
     return View::make('blog.index')->with('blogs', $blogs);
 }