public function getPaginatedData($tableName, $page = 1, $limit = 10, $orderAttribute = null, $order = 'ASC')
    {
        Paginator::currentPageResolver(function () use ($page) {
            return $page;
        });
        $data = $this->database->table($tableName);
        if (null === $orderAttribute) {
            return $data->paginate($limit)->toArray();
        }
        return $data->orderBy($orderAttribute, $order)->paginate($limit)->toArray();
    }