Load more return null

I want to use loadmore instead of pagination I found this on yii yii2-loadmore when I did try it it doesn’t load page because $model return null I get this error :

Exception 'Error' with message 'Call to a member function getUniqueId() on null'

my controller is :

public function actionIndex()
    {
        $query = Post::find();
        $query->innerJoin('user_follow', 'user_follow.user_id = '.Yii::$app->user->id);
        $posts = $query->orderBy(['updated_at'=> SORT_DESC]);
        $count = $query->count();
        $dataProvider = new ActiveDataProvider([
            'query' => $posts,
            'pagination' => [
                'pageSize' => 24,
            ],
        ]);
        if (Yii::$app->request->isAjax) {
            return $this->renderAjax('@app/humhub/views/activity/index_view', [
                'model' => $model,
            ]);
        }
        return $this->render('@app/humhub/views/activity/index_list', [
            'dataProvider' => $dataProvider,
        ]);
    }

index_list.php

<?php

use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\LinkPager;
use yii\widgets\ListView;
use sjaakp\loadmore\LoadMorePager;

echo ListView::widget([
    'dataProvider' => $dataProvider,
    'itemOptions' => ['class' => 'item'],
    'itemView' => 'index_view',
    'pager' => [
        'class' => LoadMorePager::class,
        'label' => 'Show more data'
    ], 
]);

?>

index_view.php :

<?php
use modules\file\widgets\showFiles\ShowFilesHome;
use yii\helpers\Html;
use yii\helpers\Url;
use yii\widgets\LinkPager;
/* @var $this View */
/* @var $header string */
/* @var $content string */
/* @var $footer string */
?>
<div class="wall-entry col-md-2 col-sm-3 col-xs-2">
    <div class="panel panel-default wall_<?= $model->getUniqueId() ?>" style="height:570px">
        <div class="panel-body">
            <div>
                <table style="width:100%;padding:5px">
                    <tr>
                        <td>
                            <b><?= $model->title ?></b>
                        </td>
                    </tr>
                </table>
                <hr>
            </div>
            <div class="wall-entry-body">
                <div class="wall-entry-content content" id="wall_content_<?= $model->getUniqueId() ?>">
                    <?= ShowFilesHome::widget(['object' => $model]); ?>
                </div>
            </div>
        </div>
    </div>
</div>

Perhaps this:
Important: if you use this technique, be sure to set an explicit id to the GridView or the ListView, as well as to the LoadMorePager, like so:

<?php
    use yii\grid\GridView;
    use sjaakp\loadmore\LoadMorePager;
?>
...
<?= GridView::widget([
    'dataProvider' => ...,
    'id' => 'myGrid',
    'pager' => [
        'class' => LoadMorePager::class,
        'id' => 'myPager',
        // ...other LoadMorePager options, like 'label'...
    ], 
    // ...other GridView options, like 'columns'... 
])  ?>
...

and this:

    if (Yii::$app->request->isAjax) {
        return $this->renderAjax('_loadmore', [
            'dataProvider' => $dataProvider,
        ]);
    }

Still getting the same error

Did you change model to dataprovider?

Yes I did; I changed everything ever like that not working
I did fellow everything on tutorial but not working

Now I see that in the example the GridView is loaded from the subview
(https://github.com/sjaakp/yii2-loadmore)

That makes sense, you will get populated models inside the GridView/ListView.
You will need to rearrange your views so the Listview is in the subview that are also loaded directly via Ajax.

I don’t know if you got it working but I just tried the LoadMorePager.

So in the controller: if ajax, load the subview directly, else load the normal view.
In the normal view: render the subview, propagate the dataprovider in the render call.
In the subview: instantiate the ListView, with the third view file.

bout return the same problem I’m still trying to find a way