public function __construct($structure, $rows, $searchTerm, $pagination)
{
// @todo: find a way to get rid of this dummy hack fix
$laravel = app();
if (0 === strpos($laravel::VERSION, '5.')) {
\URL::setRootControllerNamespace('');
}
$this->structure = $structure;
$this->rows = $rows;
$currentPage = $pagination->currentPage();
$paginationCount = $pagination->perPage();
$totalPaginations = $pagination->lastPage();
$pagination = ['total' => $totalPaginations, 'current' => $currentPage, 'count' => $paginationCount];
$this->index_prefix($searchTerm);
$this->index_content($rows, $pagination);
$this->index_postfix($pagination, $searchTerm);
return $this->html;
}