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 3 years have passed since last update.

Laravel 9ページネーションによる列のソート

0
Posted at

1 : kyslik/column-sortable パッケージのインストール

composer require kyslik/column-sortable

詳細はgithubへ
https://github.com/Kyslik/column-sortable

2: config/app.php

パッケージをインストールしたら、 config/app.phpディレクトリに移動して、サービス プロバイダーとエイリアスを追加する必要があります。次のコードをファイルに追加します。

config/app.php
'providers' => [
    Kyslik\ColumnSortable\ColumnSortableServiceProvider::class,
]

image.png

3: 次のコマンドでデフォルト設定を公開

php artisan vendor:publish --provider="Kyslik\ColumnSortable\ColumnSortableServiceProvider" --tag="config"

config フォルダーに新しいcolumnortable.phpが作成されていることがわかります。必要に応じて、デフォルトの構成をファイルに変更できます。
image.png

3 モデルに次のコードを追加

image.png
4 # コントローラーの作成
image.png
#5 resources /view/フォルダー
image.png

参考サイト
https://laraveltuts.com/laravel-9-sorting-columns-with-pagination/

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?