简体   繁体   中英

Laravel pagination link not working in blade file

My pagination works right at localhost but not at server.The page counts are displayed correctly, but the first page information is only displayed.

controller :

$customers = Customer::orderBy('id','desc')->paginate(10);
return view('admin.customers_list',compact('customers'));

view :

{{$customers->links()}};

route:

Route::resource('customer','Admin\CustomersController');

If it's working fine at localhost, maybe you should check your server configuration for handling routes.

if you are using Nginx as your web server you can add these lines to your config:

location / {
    try_files $uri $uri/ /index.php?$query_string;
}

And in case of using apache:

<Directory "path/to/your/project">
    AllowOverride All
</Directory>

is necessary.

I hope it would work for you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM