Example #1
0
 public function getPaginated(array $params)
 {
     if ($params['sortBy'] || $params['order']) {
         return Article::orderBy($params['sortBy'], $params['order'])->paginate(10);
     }
     return Article::paginate(10);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $limit = \Input::get('limit') ?: 7;
     $articles = Article::paginate($limit);
     //dd(get_class_methods($articles));
     return $this->responseWithPagination($articles, ['data' => $this->articleTransformer->transformCollection($articles->all())]);
 }
Example #3
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //$data = DB::table('article')->get();
     $data = Article::paginate(3);
     //var_dump($data);die;
     return view('fontend.examples.index', ['data' => $data]);
 }
Example #4
0
 public function index()
 {
     $articles = Article::paginate(PAGINATE);
     $categories = Category::all();
     $cate_id = -1;
     return view('admin.articles.index')->with(compact('articles', 'categories', 'cate_id'));
 }
 public function showArticles()
 {
     $articles = Article::paginate(5);
     if (Request::ajax()) {
         return Response::json(View::make('admin.article.articles', array('articles' => $articles))->render());
     }
     return View::make('admin.article.index', array('articles' => $articles));
 }
Example #6
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $Article = new Article();
     $rslist = $Article->paginate(10);
     $rslist->setPath("article");
     $pages = new BootstrapThreePresenter($rslist);
     return view("Admin/article/list")->with(["pages" => $pages, "rslist" => $rslist->toArray()]);
 }
 public function index()
 {
     // Tao bien de lay du lieu
     //$articles = Article::All(); Ham nay lay toan bo du lieu va show len
     //
     // Tuy nhien nen viet nhu ben duoi de thuc hien phan trang
     $articles = Article::paginate(4);
     return view('articles.index', compact('articles'));
     // Trong Controller sau khi xu ly lay du lieu tu Model
     // sau do tra ve cho 1 view ten index de hien ra
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     //		return view('articles.index')->withArticles(Article::paginate(2));
     //		$articles = Article::simplePaginate(2);
     $articles = Article::paginate(2);
     //		$articles->setPath('/articles');
     //		$articles->appends(['sort' => 'votes']);
     //		$articles->fragment('foo');
     return view('articles.index', ['articles' => $articles]);
 }
Example #9
0
 public function showArticles()
 {
     $articles = Article::paginate(2);
     if (Auth::check()) {
         $user = Auth::user();
         $userid = $user->id;
         $articles->theuser = $userid;
     } else {
         $articles->theuser = 0;
     }
     return view('layouts.articles', ['articles' => $articles]);
 }
 /**
  * Display a listing of the resource.
  */
 public function index()
 {
     return json()->withPagination(\App\Article::paginate(5), new ArticleTransformer());
 }
 public function index()
 {
     $articles = Article::paginate(5);
     $articles->setPath('articles/');
     return view('article.index', compact('articles'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $articles = Article::paginate(3);
     return view('AdminHome')->withArticles($articles);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $article = Article::paginate(5);
     return view('articles.index', compact('article'));
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     pagetitle([trans('news.index'), settings('server_name')]);
     $articles = Article::paginate();
     return view('admin.news.view', compact('articles'));
 }
Example #15
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $data = Article::paginate(15);
     //$data = DB::table('article')->get();
     return view('backend.article.index', ['data' => $data]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $article = Article::paginate(20);
     return view('article-list')->with('article', $article);
 }
Example #17
0
 public function index()
 {
     //$articles = Article::all();
     $articles = Article::paginate(4);
     return view('articles.index', compact('articles'));
 }
Example #18
0
 /**
  * Show the application welcome screen to the user.
  *
  * @return Response
  */
 public function index()
 {
     $articles = Article::paginate(9);
     return view('welcome', ['articles' => $articles]);
 }
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $articles = Article::paginate(10);
     return view('index', compact('articles'));
 }
Example #20
0
 public function getIndex()
 {
     return Article::paginate(15);
 }