I have built a table component in livewire. I can pass all the parameters from my main model component to the table component and everything works fine except the pagination links.
Here is the error
Property type not supported in Livewire for property: [{"current_page":1,"data":[{"id":27,....... .......}],"first_page_url":"http://localhost:8000/employees?employee_page=1","from":1,"last_page":2,"last_page_url":"http://localhost:8000/employees?employee_page=2","links":[{"url":null,"label":"« Previous","active":false},{"url":"http://localhost:8000/employees?employee_page=1","label":"1","active":true},{"url":"http://localhost:8000/employees?employee_page=2","label":"2","active":false},{"url":"http://localhost:8000/employees?employee_page=2","label":"Next »","active":false}],"next_page_url":"http://localhost:8000/employees?employee_page=2","path":"http://localhost:8000/employees","per_page":20,"prev_page_url":null,"to":20,"total":27}]
Here is my code in main component:
@livewire('includes.dynamicdatatable.table', [
'table' => $table,
'table_tabs_buttons' => $this->table_tabs_buttons,
'table_filter_rows' => $this->table_filter_rows,
'table_rows' => $this->table_rows,
'table_pagination_infos' => $this->tablePaginationInfos,
'model' => $this->employees,
])
This is the code in nested component:
<div class="col-4">
{{ $this->model->links() }}
</div>
This is the code in nested component mount method:
public function mount($table, $table_tabs_buttons, $table_filter_rows, $table_rows, $table_pagination_infos, $model)
{
$this->initial_table = $table;
$this->table = $table;
$this->table_tabs_buttons = $table_tabs_buttons;
$this->table_filter_rows = $table_filter_rows;
$this->table_rows = $table_rows;
$this->table_pagination_infos = $table_pagination_infos;
$this->model = $model;
}
How can i pass the pagination links to my nested component properly?