التمرير اللانهائي:
المكون
public int $perPage = 10;
public function loadMore()
{
$this->perPage += 10;
}
#[Computed]
public function posts()
{
return Post::latest()->take($this->perPage)->get();
}العرض
@foreach($this->posts as $post)
<div>{{ $post->title }}</div>
@endforeach
<div x-intersect="$wire.loadMore()">
<span wire:loading>جاري تحميل المزيد...</span>
</div>مع Alpine Intersect
x-intersect.full="$wire.loadMore()"