samedi 11 juin 2016

Laravel 5.1 query string parameter not working in pagination

I am using laravel 5.1 pagination. But its not working. I guess the problem is accessing query string parameter.

routes.php

Route::get('blogs', 'front\FrontController@blog');

Controller

public function blog(Request $request)
{
    print_r($request->fullUrl());
    die;
    $blogs=Blog::with('User')->where('flag','!=','0')->paginate(2);
    return view('front.pages.blog_list',['blogs'=>$blogs]);
}

For url http://localhost/myproject/blogs?page=2

Result : http://localhost/myproject/blogs?blogs. Where it should be ?page=2 instead of ?blogs. I have also noticed that query string parameters are not also working in others page. Any idea? Thanks in advance.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire