F.Joodaki
F.Joodaki

Reputation: 151

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');

Upvotes: 0

Views: 657

Answers (1)

Morteza Pouretemadi
Morteza Pouretemadi

Reputation: 648

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

Upvotes: 1

Related Questions