I am using livewire trying to paginate the table
public function mount($lab = null)
{
$this->sample = new Sample;
if ($lab) {
$this->lab = Lab::find($lab);
$this->samples = Sample::whereLabId($this->lab->id)->paginate(5);
}
}
I got this error:
Livewire\Exceptions\PublicPropertyTypeNotAllowedException
Livewire component's [sample-data] public property [samples] must be of type: [numeric, string, array, null, or boolean]. Only protected or private properties can be set as other types because JavaScript doesn't need to access them.
I know that the variable $this->samples is an instant not a numeric, string or array... but eventhow I need to do the pagination
How can I do that?