laravel-collections

Installation
SKILL.md

Laravel Collections & associative array reads

1. collect() over native array functions

Always use collect() for array transformations. There are no native-array exceptions — even a single map is more readable as a Collection chain, and the rule should be uniform across the codebase so reviewers don't have to weigh whether a given case "qualifies".

// Good
collect($items)
    ->map(fn (string $value): ?Status => Status::tryFrom((int) $value))
    ->filter()
    ->values()
    ->all();
Installs
4
First Seen
May 6, 2026
laravel-collections — glamorous/coding-skills