NTR893
@NTR893 (おいなり)

Are you sure you want to delete the question?

Leaving a resolved question undeleted may help others!

変数の中にある項目を、取り出したい

Q&A

Closed

解決したいこと

質問失礼いたします。

変数$aの中に、変数$postの中(画像左側)にあるtotalという項目の中身を入れたいです。
どうすれば入るか教えて頂きたく、質問を致しました。

image.png

0

1Answer

Illuminate\Pagination\LengthAwarePaginatorには、アイテムの総数を取得するtotalメソッドがあるので、それで取得できないでしょうか?

0Like

Comments

  1. ↓こうですかね?

    $a = $posts->total();
    
  2. @NTR893

    Questioner

    ありがとうございます!出来ました。

Your answer might help someone💌