henzeb / laravel-typed-collection
Laravel typed collections
v1.11.0
2024-03-09 13:34 UTC
Requires
- php: ^8.1
- illuminate/collections: ^10|^11
Requires (Dev)
- calebporzio/sushi: ^2.4
- orchestra/testbench: ^8.0|^9
- phpstan/phpstan: ^1.4
- phpunit/phpunit: ^9.6.6|^10
- ramsey/uuid: ^4.2.2
- symfony/uid: ^5.1|^6.3|^7
Suggests
- ramsey/uuid: ^4.2.2
- symfony/uid: ^5.1|^6.3|^7
README
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
- Generic Typed Collections
- Returnable Typed Collections
- Types and Collections
- Helper Methods
- Casting
- Eloquent
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.