コード例 #1
0
ファイル: PostsController.php プロジェクト: shawon922/blog
 public function index()
 {
     $page_title = 'This is HomePage';
     $posts = Post::latest('published_at')->published()->get();
     $posts = Post::paginate(5);
     //dd($posts);
     return view('posts.index', compact('page_title', 'posts'));
 }
コード例 #2
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     if (Request::get('filter')) {
         $records = Post::where('title', 'LIKE', '%' . Request::get('filter') . '%')->paginate(10);
     } else {
         $records = Post::paginate(10);
     }
     return view('back::scope.blog.posts.index', compact('records'));
 }
コード例 #3
0
    /**
     * Show the profile for the given user.
     *
     * @param  int  $id
     * @return Response
     */
    public function getIndex()
    {

        return view('home')
            ->with('posts', Post::paginate(10))
            ->with('title', 'Blog | Home')
            ->with('description','This is the Home Page Blog')
            ->with('category', Category::all());
    }
コード例 #4
0
ファイル: ApiPostsController.php プロジェクト: neshikj/Bloggy
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $limit = Input::get('limit') ?: 5;
     if ($limit > 15) {
         return $this->respondLimitNotAllowed('You are not allowed to fetch more than 15 posts per page.');
     }
     $posts = Post::paginate($limit);
     return $this->respondWithPagination($posts, ['data' => $this->postTransformer->transformCollection($posts->all())]);
 }
コード例 #5
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index(Request $request)
 {
     $search = '';
     if ($search = $request->input('search')) {
         $posts = Post::where('title', "LIKE", "%" . $search . "%")->orWhere('body', "LIKE", "%" . $search . "%")->paginate(10);
     } else {
         $posts = Post::paginate(10);
     }
     return view('posts.index', compact('posts', 'search'));
 }
コード例 #6
0
 /**
  * Show the application dashboard to the user.
  *
  * @return Response
  */
 public function index()
 {
     $user = \Auth::user();
     $posts = \App\Post::all();
     $posts = \App\Post::paginate(3);
     $users = \App\User::all();
     $users = \App\User::paginate(3);
     $fiches = \App\Fiche::all();
     if ($user->role == "teacher") {
         $fiches = \App\Fiche::paginate(3);
     }
     if ($user->role == "teacher") {
         return view('back.index', compact('posts', 'users', 'fiches', 'user'));
     } else {
         return view('backStudent.index', compact('fiches', 'user'));
     }
 }
コード例 #7
0
 public function index()
 {
     $posts = Post::paginate();
     return view('posts/list', compact('posts'));
 }
コード例 #8
0
ファイル: PostsController.php プロジェクト: petrovitch/chess
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //        $posts = Post::all();
     $posts = Post::paginate(env('PAGINATION_MAX'));
     return view('backend.posts.index', compact('posts'));
 }
コード例 #9
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $posts = Post::paginate(20);
     $section = Section::where('service_id', '1')->where('status', 1)->orderBy('sort_id')->get();
     return view('admin.posts.index', compact('posts', 'section'));
 }
コード例 #10
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $posts = \App\Post::paginate(10);
     return view('posts.index', compact('posts'));
 }
コード例 #11
0
ファイル: BlogController.php プロジェクト: xenodus/lco_proj
 public function manage()
 {
     $items_per_page = 10;
     $data['posts'] = App\Post::paginate($items_per_page);
     return view('blog/manage', $data);
 }
コード例 #12
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $posts = $this->post->paginate(10);
     return view('admin.posts.index', compact('posts'));
 }
コード例 #13
0
ファイル: AdminController.php プロジェクト: guillospy92/blogs
 public function desktop()
 {
     $post = Post::paginate(5);
     return view('desktop', compact('post'));
 }
コード例 #14
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $posts = Post::paginate(5);
     $data = ['posts' => $posts];
     return view('adminpage.post.post', $data);
 }
コード例 #15
0
ファイル: BlogController.php プロジェクト: petrovitch/chess
 public function get()
 {
     $posts = Post::paginate(env('PAGINATION_MAX'));
     return $posts;
 }
コード例 #16
0
 public function index()
 {
     $posts = Post::paginate(15);
     return view('welcome', ['posts' => $posts]);
 }
コード例 #17
0
 public function index()
 {
     $posts = $this->postModel->paginate(5);
     return view('blog.index', compact('posts'));
 }
コード例 #18
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $post = Post::paginate(15);
     return view('post.index', compact('post'));
 }
コード例 #19
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $limit = Input::get('limit') ?: 5;
     $posts = Post::paginate($limit);
     return $this->respondWithPaginate($posts, ['data' => $this->blogTransformer->transformCollection($posts->all())]);
 }
コード例 #20
0
ファイル: HomeController.php プロジェクト: rulzi/larablog
 /**
  * Show the application dashboard.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     $posts = Post::paginate(2);
     $data = ['posts' => $posts, 'nextpage' => $posts->nextPageUrl(), 'prevpage' => $posts->previousPageUrl()];
     return view('home', $data);
 }
コード例 #21
0
ファイル: PostController.php プロジェクト: ofcadavidm/larapp
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $posts = Post::paginate(6);
     $posts->setPath('blog');
     return view('posts.index', compact('posts'));
 }
コード例 #22
0
ファイル: AdminPostsController.php プロジェクト: AbuLoot/vi
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $posts = Post::paginate(20);
     $sections = Section::all();
     return view('admin.posts.index', compact('posts', 'sections'));
 }
コード例 #23
0
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     $posts = Post::paginate(25);
     $posts->setPath('posts');
     return view('post.index', ['posts' => $posts]);
 }
コード例 #24
0
ファイル: PostController.php プロジェクト: nutsdo/mz-service
 /**
  * Display a listing of the resource.
  *
  * @return Response
  */
 public function index()
 {
     //
     $posts = Post::paginate(15);
     return view('admin.post.index', compact('posts'));
 }
コード例 #25
0
 /**
  * Display a listing of the resource.
  *
  * @return \Illuminate\Http\Response
  */
 public function index()
 {
     return view('post.index', ['posts' => Post::paginate(10)]);
 }