File: /home/armgroup/libs/app/Http/Livewire/Frontend/Product/Comment/Index.php
<?php
namespace App\Http\Livewire\Frontend\Product\Comment;
use App\Models\Comment;
use Livewire\Component;
class Index extends Component
{
public $commentableT;
public $commentableI;
public $perPage = 2;
public function render()
{
return view('livewire.frontend.product.comment.index', [
'comments' => Comment::where('commentable_type', $this->commentableT)
->where('commentable_id', $this->commentableI)
->where('status', Comment::STATUS_APPROVED)
->whereNull('parent_id')
->with('feedback', 'scores')
->latest()
->paginate($this->perPage),
]);
}
public function loadMore()
{
$this->perPage += 2;
}
}