0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

laravelでページネーションが動かなかった

Posted at

  
いつものようにDocker立ち上げて、
laravel作って、
ページネーションを追加

public function index()
    {
        return view('user.index', [
            'users' => DB::table('users')->paginate(15)
        ]);
    }

   
   

しかし、
ページネーションは表示されるけど、2ページ目、3ページ目のボタンを押しても
1ページ目から変化しない!
   
  

色々調べた結果、Dockerで立ち上げたnginxの設定が間違えてた。
ページネーションはurlパラメータを使うので、その設定が間違えてたみたい。

nginxの設定ファイルのlocationに設定を入れて、治りました。

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

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?