Exemple #1
0
 public static function blogs($type = null, $data = null)
 {
     if ($type and $data) {
         return Blog::where($type, $data)->get();
     }
     return Blog::all();
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     // Grab all the blogs
     $blogs = Blog::all();
     // Show the page
     return View('admin.blog.index', compact('blogs'));
 }
 public function getDashboardData()
 {
     $blogCount = Blog::all()->count();
     $tagCount = Tag::all()->count();
     $contactCount = ContactMails::where('messageStatus', 0)->count();
     $totalCount = ContactMails::all()->count();
     $totalHit = UserLog::all()->count();
     return 1;
     #$Response = array('success' => '1', 'blogCount' => $blogCount, 'tagCount' => $tagCount , 'contactCount' => $contactCount, 'totalCount' => 'totalHit' => $totalHit);
 }
 public function index()
 {
     $posts = Blog::all();
     $post_collection = new Collection($posts);
     $blog_id_list = $post_collection->lists('id');
     $id_arr = array();
     foreach ($blog_id_list as $id) {
         array_push($id_arr, $id);
     }
     $rand_id = mt_rand(0, count($id_arr) - 1);
     $banner_post = Blog::findOrFail($id_arr[$rand_id]);
     //($banner_post->toArray());
     return view('blog.homepage', compact('posts'))->with(['banner_post' => $banner_post]);
 }
Exemple #5
0
 public function __construct()
 {
     $A_authors = Author::all();
     view()->share('A_authors', $A_authors);
     $A_projects = Project::all();
     view()->share('A_projects', $A_projects);
     $A_blogs = Blog::all();
     view()->share('A_blogs', $A_blogs);
     $A_newsletters = Newsletter::all();
     view()->share('A_newsletters', $A_newsletters);
     $A_quotations = Quotation::all();
     view()->share('A_quotations', $A_quotations);
     $quotations = Quotation::all();
     //dump($quotations);
     $quotations = count($quotations) > 1 ? $quotations->random(2) : $quotations;
     view()->share('quotations', $quotations);
 }
 public function listBlog()
 {
     $blogs = Blog::all();
     return view('admin.blog.listBlog')->with('blogs', $blogs);
 }
Exemple #7
0
<?php

/*
|--------------------------------------------------------------------------
| Application Routes
|--------------------------------------------------------------------------
|
| Here is where you can register all of the routes for an application.
| It's a breeze. Simply tell Laravel the URIs it should respond to
| and give it the controller to call when that URI is requested.
|
*/
use App\Blog;
Route::get('/', function () {
    $blogs = Blog::take(5)->orderBy('created_at', 'desc')->get();
    return view('home', compact('blogs'));
});
Route::get('angular', function () {
    return view('angular');
});
Route::get('foo', function () {
    return Blog::all();
});
Route::resource("comments", "CommentController");
Route::resource("blogs", "BlogController");
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $blogs = Blog::all();
     //where('updated_at', '>', Carbon::now())->get()->all();
     return view('live.home', compact('blogs'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $blog_posts = Blog::all();
     return view('admin.blog.overview', compact('blog_posts'));
 }
 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     $section = 'home';
     $posts = Blog::all(['id', 'title', 'post', 'picture', 'updated_at', 'thumb_picture']);
     return view('welcome', compact('section', 'posts'));
 }
 public function index()
 {
     return BlogModel::all();
 }
 public function blog()
 {
     $blog_model = Blog::all();
     return view('main.blog', ['model' => $blog_model]);
 }
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     $posts = Blog::all(['id', 'title', 'post', 'picture', 'created_at']);
     return view('admin', compact('posts'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $blogs = Blog::all();
     return view('blog.index', ['blogs' => $blogs]);
 }
Exemple #15
0
 public function blogs($username)
 {
     $blogs = Blog::all();
     return view('admin.blogs')->with(['blogs' => $blogs]);
 }
Exemple #16
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $blogs = Blog::all();
     return view('blog.view', compact('blogs'));
 }
 public function index()
 {
     $blogs = Blog::all();
     return view('blogs.index')->with('blogs', $blogs);
 }
 public function blogs()
 {
     $blogs = Blog::all();
     return view('blogs.blogs')->with('blogs', $blogs);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     //
     $blogs = Blog::all();
     return view('blogs.Blogindex')->withBlogs($blogs);
 }