PHPackages                             hi-folks/data-block - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. hi-folks/data-block

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

hi-folks/data-block
===================

Data class for managing nested arrays and JSON data.

v1.2.0(4mo ago)1472.2k↓29.6%7[1 PRs](https://github.com/Hi-Folks/data-block/pulls)MITPHPPHP ^8.2|^8.3|^8.4|^8.5CI passing

Since Jun 15Pushed 4mo ago1 watchersCompare

[ Source](https://github.com/Hi-Folks/data-block)[ Packagist](https://packagist.org/packages/hi-folks/data-block)[ Docs](https://github.com/hi-folks/data-blocks)[ RSS](/packages/hi-folks-data-block/feed)WikiDiscussions main Synced 1mo ago

READMEChangelog (10)Dependencies (8)Versions (38)Used By (0)

 [![PHP Data Block package](https://raw.githubusercontent.com/Hi-Folks/data-block/main/cover-data-block.png)](https://raw.githubusercontent.com/Hi-Folks/data-block/main/cover-data-block.png)

 Data Block Package
====================

[](#----data-block-package)

 [ ![Latest Version](https://camo.githubusercontent.com/cbb5850b787849cf039451a4335fb3b88387d7e212c669e8d308f2610e5932cc/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f762f68692d666f6c6b732f646174612d626c6f636b2e7376673f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/hi-folks/data-block) [ ![Total Downloads](https://camo.githubusercontent.com/0cb0d753fe5b94e23ad804930d6775757881b201bb035f0e6fcbc3d429e80767/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f68692d666f6c6b732f646174612d626c6f636b2e7376673f7374796c653d666f722d7468652d6261646765) ](https://packagist.org/packages/hi-folks/data-block)
 [![Packagist License](https://camo.githubusercontent.com/62661a08c7ab8ddb949aa684ad71367a6987f975fd5512b07f227e0b3f66348f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f68692d666f6c6b732f646174612d626c6f636b3f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/62661a08c7ab8ddb949aa684ad71367a6987f975fd5512b07f227e0b3f66348f/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f6c2f68692d666f6c6b732f646174612d626c6f636b3f7374796c653d666f722d7468652d6261646765) [![Supported PHP Versions](https://camo.githubusercontent.com/abb9ffc204b71a6cebf1b773c90cdbde6ef8e23d05fd96613edcda05754c9c00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f68692d666f6c6b732f646174612d626c6f636b3f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/abb9ffc204b71a6cebf1b773c90cdbde6ef8e23d05fd96613edcda05754c9c00/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f7068702d762f68692d666f6c6b732f646174612d626c6f636b3f7374796c653d666f722d7468652d6261646765) [![GitHub last commit](https://camo.githubusercontent.com/2b856727e01627c3badbaa11eebc4e0f1c510c4b7102eb3d311605f469217579/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f68692d666f6c6b732f646174612d626c6f636b3f7374796c653d666f722d7468652d6261646765)](https://camo.githubusercontent.com/2b856727e01627c3badbaa11eebc4e0f1c510c4b7102eb3d311605f469217579/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6173742d636f6d6d69742f68692d666f6c6b732f646174612d626c6f636b3f7374796c653d666f722d7468652d6261646765)
 [![Tests](https://camo.githubusercontent.com/73b03ae45629744a0c728f4819c53352ad4793202b5d6785aacac7fc25b4339c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f68692d666f6c6b732f646174612d626c6f636b2f72756e2d74657374732e796d6c3f7374796c653d666f722d7468652d6261646765266c6162656c3d54657374)](https://camo.githubusercontent.com/73b03ae45629744a0c728f4819c53352ad4793202b5d6785aacac7fc25b4339c/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f616374696f6e732f776f726b666c6f772f7374617475732f68692d666f6c6b732f646174612d626c6f636b2f72756e2d74657374732e796d6c3f7374796c653d666f722d7468652d6261646765266c6162656c3d54657374)

  *PHP Package for Managing Nested Data*

This PHP package provides classes and methods for easily managing, querying, filtering, and setting nested data structures. The PHP Data Block package offers a streamlined approach to handling nested data, whether you're working with complex JSON data, hierarchical configurations, or deeply nested arrays. Articles about PHP DataBlock
----------------------------

[](#articles-about-php-datablock)

If you want to learn more about DataBlock through real-world examples and tutorials, here are some articles that mention or use it:

- **Laravel News** — [Handle Nested Data Structures in PHP with the Data Block Package](https://laravel-news.com/data-block)
- **Roberto Butti** — [Handling Nested PHP Arrays Using DataBlock](https://dev.to/robertobutti/handling-nested-php-arrays-using-datablock-26d7)
- **Roberto Butti** — [Exploring Real-World APIs with DataBlock](https://dev.to/robertobutti/exploring-real-world-apis-with-datablock-459i)

What you can do with PHP Data Block
-----------------------------------

[](#what-you-can-do-with-php-data-block)

For example, with PHP Data Block, you can retrieve complex JSON from an API and then filter, sort, and handle the data. For example, here you can:

- Retrieve the list of the repository from GitHub
- Order the repository by the number of stars received (ascending, starting from the repos with more stars)
- Loop the results
- Get values from elements

```
