/**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $blogs = Blog::latest('published_at')->published()->paginate(5);
     $categories = Category::all();
     return view('blogs.index', compact('blogs', 'categories'));
 }
 /**
  * Return the view for the blog index page
  */
 public function index()
 {
     $blogs = Blog::latest('published_at')->published()->get();
     $latest = Blog::latest()->first();
     // Also retrieve latest blog
     return view('blog.index', compact('blogs', 'latest'));
 }
 /**
  * @return \Illuminate\View\View
  */
 public function getIndexFrontend()
 {
     // Grab all the blogs
     $blogs = Blog::latest()->simplePaginate(5);
     $blogs->setPath('blog');
     $tags = $this->tags;
     // Show the page
     return View('blog', compact('blogs', 'tags'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     if (\Auth::guest()) {
         $blog = \App\Blog::where('status', 'publish')->latest()->paginate(5);
         $photo = \App\Photo::get();
     } else {
         return redirect('/');
         $blog = \App\Blog::latest()->paginate(5);
         $photo = \App\Photo::get();
     }
     return view('blog.list', compact('blog'))->with('photo', $photo);
 }
Exemple #5
0
 /**
  * @return \Illuminate\View\View
  */
 public function getIndexFrontend()
 {
     //featured blog
     $featured = Blog::where('featured', 1)->first();
     // Grab all the blogs
     $blogs = Blog::latest()->where('id', '!=', $featured->id)->simplePaginate(5);
     $blogs->setPath('blog');
     $tags = $this->tags;
     //return $tags;
     $latest = Blog::latest()->take(5)->get();
     // Show the page
     return View('blog.index', compact('featured', 'blogs', 'tags', 'latest'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $blogs = Blog::latest()->get();
     return view('admin.blogs.showAllBlog')->with('blogs', $blogs);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $blogs = Blog::latest()->get();
     return view('blogs.index')->with('blogs', $blogs);
 }
 /**
  * @return \Illuminate\View\View
  *
  * This function will return the index view.
  */
 public function index()
 {
     $blogs = Blog::latest('published_at')->published()->paginate(config('blog.posts_per_page'));
     return view('blog.index', compact('blogs'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $blog = \App\Blog::latest()->first();
     $project = \App\Project::latest('date_created')->first();
     return view('welcome')->with(compact('blog', 'project'));
 }
 /**
  * Bootstrap any application services.
  *
  * @return void
  */
 public function boot()
 {
     view()->composer('partials.navbar', function ($view) {
         $view->with('latest', Blog::latest()->first());
     });
 }