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!
Just install with the following command.
composer require henzeb/laravel-typed-collection
- Generic Typed Collections
- Returnable Typed Collections
- Types and Collections
- Helper Methods
- Casting
- Eloquent
composer test
Please see CONTRIBUTING for details.
If you discover any security related issues, please email henzeberkheij@gmail.com instead of using the issue tracker.
The GNU AGPLv. Please see License File for more information.