The issue is that the $item variable is being set to an empty array when $readyToLoad is false. This causes an error when trying to call the links() method on an array. To fix this, you can check if $item is an array before calling the links() method. Here's an updated render() method:
public function render()
{
$logs = $this->readyToLoad
? LogsPublic::where('id_user', $this->member_id)->orderby('created_at','desc')->paginate('10')
: [];
return view('livewire.profile-timeline', [
'item' => $logs,
]);
}
And here's the updated blade file:
<div wire:init="loadItems">
[...]
<div class="flex justify-center mt-2">
@if(is_array($item))
{{ $item->links() }}
@endif
</div>
</div>