Skip to content

Instantly share code, notes, and snippets.

View pioneersingh321's full-sized avatar

Pioneer Singh pioneersingh321

  • acewebcreations
  • Delhi
View GitHub Profile
<?php
namespace App\Libraries;
use CodeIgniter\I18n\Time;
use ReturnTypeWillChange;
/**
* Carbon - A Carbon-like extension of CodeIgniter Time
*
@pioneersingh321
pioneersingh321 / gist:2fe092c8415a1f4d3b35b9dd2e62968a
Last active August 19, 2025 10:37
Codeigniter 4 Array Collection Library
# Collection Class for CodeIgniter 4 / PHP 8.2
**Namespace:** `App\Libraries`
**Implements:** `IteratorAggregate`, `Countable`, `ArrayAccess`, `JsonSerializable`
A utility class to work with arrays in an object-oriented, chainable manner. Supports filtering, mapping, grouping, aggregation, pagination, and JSON/array conversion. Includes helpers: `increment`, `decrement`, `push`, `merge`, `prepend`.
---
## Full Class Code