New

Just launched: Vueblocks, a brand-new search engine for Vue packages! Explore Vueblocks →

henzeb/laravel-typed-collection

Laravel typed collections
1,866 7
Install
composer require henzeb/laravel-typed-collection
Latest Version:v1.14.0
PHP:^8.1
Laravel:10 – 13
Older releases:9
License:AGPL-3.0-only
Last Updated:Jul 3, 2026
Links: GitHub  ·  Packagist
Maintainer: henzeb

Laravel Typed Collection

Build Status Latest Version on Packagist Total Downloads License

PHP has no support for Generics. Yet sometimes, we want to be sure we receive an array of a certain type.

Using Laravel's Collections, we should be able to force types. This package allows you to.

Unlike many other packages, this one has support for Eloquent!

Installation

Just install with the following command.

composer require henzeb/laravel-typed-collection

usage

Testing this package

composer test

Contributing

Please see CONTRIBUTING for details.

Security

If you discover any security related issues, please email henzeberkheij@gmail.com instead of using the issue tracker.

Credits

License

The GNU AGPLv. Please see License File for more information.

Related Packages

webparking/laravel-type-safe-collection

This package provides type-safe extension of the laravel collection, forcing a s...

8,240 37
gamez/typed-collection

Type-safe collections based on Laravel Collections

387,882 46
vistik/type-hinted-arrays

A simple way to create typed collections in PHP - build on Illuminate\Support\Co...

8,892 1
collector/collector

A collection library inspired by Laravel Collections, built using generators to...

208 15
typicms/nestablecollection

A Laravel Package that extends Collection to handle unlimited nested items follo...

354,798 88

Version History

Version Released PHP Laravel License
v1.14.0 ^8.1 ^10|^11|^12|^13 AGPL-3.0-only
v1.13.0 ^8.1 ^10|^11|^12 AGPL-3.0-only
v1.12.0 ^8.1 ^10|^11|^12 AGPL-3.0-only
v1.11.0 ^8.1 ^10|^11 AGPL-3.0-only
v1.10.0 ^8.1 ^9.0.0|^10 AGPL-3.0-only