pragmarx/coollection
Coollection repackages Laravel-style collections (via Tightenco\Collect) to let you access items as object properties. Traverse nested arrays/objects with fluent collection methods, then read values like $countries->where('name.common','US')->first()->currency->name.
Pros:
Tightenco\Collect (Laravel’s core Collection extracted) and Illuminate\Support\Collection, ensuring seamless integration with Laravel’s ecosystem.$collection->user->address->city), reducing boilerplate and improving readability.where, filter, map) while adding property access, making it ideal for Laravel applications.IlluminateExtracted\Support\Collection, though this is less relevant for Laravel TPMs.Cons:
illuminate/collections dependency).$request->all() → $input->pagination->perPage).Collection (e.g., testing tools, data validation).coollect() or Coollection instead of collect().Collection; no breaking changes to existing code.$collection->user->address if user is dynamic).->get('user.address')).sortByKey()) may not be critical but could matter in high-throughput systems.pragmarx/ia-str and pragmarx/ia-arr as dev dependencies (though not runtime dependencies).illuminate/collections versions (e.g., ^10.48|^11.29), requiring updates for newer Laravel releases.$collection->user->address over $collection->get('user.address')?Collection changes? (e.g., Laravel 12+ compatibility).ArrayAccess, __get()) achieve similar goals without a package?spatie/array-to-object) with broader adoption?Illuminate\Support\Collection or Tightenco\Collect.coollect() won’t work).illuminate/collections dependency.collect() usage with coollect() in a non-critical module to test readability gains.Benchmark or Xdebug (focus on property access vs. get()).collect() with coollect() in API response handling (e.g., $request->all()).$users->where('active', true)).$data['user']['address'] → $data->user->address).Coollection or coollect().get() calls with properties.illuminate/collections dependency).pragmarx/coollection for compatibility).pragmarx/ia-str and pragmarx/ia-arr are dev dependencies only; no runtime conflicts.Collection-related packages (e.g., spatie/array-to-object), but unlikely in Laravel.illuminate/collections installed.get() calls or array dereferencing (e.g., $data['user']['address']).$user->address).where, map, etc.), so maintenance aligns with Laravel updates.pragmarx/coollection staying updated with Laravel’s Collection changes.$collection->user->address vs. $collection->get('user.address')).dd($collection) or Xdebug to inspect the underlying array structure.get() calls.Collection structure.Collection design.$collection->nonexistent) throws ErrorException (same as Laravel’s Collection).has() or get() for dynamic keys or add validation.@property PHPDoc annotations or cast to array when needed.How can I help you explore Laravel packages today?