I’m trying to add pagination within a section of my Livewire view but I receive this error:
Method Illuminate\Database\Eloquent\Collection::links does not exist
Here is the render function of my controller with the paginate function:
public function render()
{
return view('livewire.contactshow')
->withContactnotes($this->contacts->contactnotes()->paginate(5));
}
Here is my view attempting to show the pagination links:
{{ $this->contacts->contactnotes->links() }}
I obviously have this written to use the relationship between contacts and contactnotes, but that might not work with the paginate() syntax, but I’m not sure how to change it.