informationArray = [ "meta" => [ "title" => $title, "columns" => $columns, "perPage" => 10, "currentPage" => 1, "params" => [ "class" => "table table-bordered", "border" => "1" ] ], "data" => $data ]; return $this->toJson($this->informationArray); } return null; } /** * @param array $infArr * @return string|null */ protected function toJson(array $infArr): ?string { if ($infArr) return json_encode($infArr, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE); return null; } }