{"id":36981771,"url":"https://github.com/sjelfull/craft3-collections","last_synced_at":"2026-01-13T22:51:38.573Z","repository":{"id":26857735,"uuid":"111224785","full_name":"sjelfull/craft3-collections","owner":"sjelfull","description":"Clean up those complex templates with Laravel Collections","archived":true,"fork":false,"pushed_at":"2022-07-14T19:24:30.000Z","size":46,"stargazers_count":24,"open_issues_count":0,"forks_count":4,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-08-10T08:49:11.566Z","etag":null,"topics":["craft","craft3","craftcms","craftcms-plugin"],"latest_commit_sha":null,"homepage":"https://superbig.co","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sjelfull.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-11-18T17:26:53.000Z","updated_at":"2023-03-31T00:04:19.000Z","dependencies_parsed_at":"2022-07-27T08:52:36.254Z","dependency_job_id":null,"html_url":"https://github.com/sjelfull/craft3-collections","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/sjelfull/craft3-collections","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2Fcraft3-collections","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2Fcraft3-collections/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2Fcraft3-collections/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2Fcraft3-collections/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sjelfull","download_url":"https://codeload.github.com/sjelfull/craft3-collections/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sjelfull%2Fcraft3-collections/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28402159,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-13T14:36:09.778Z","status":"ssl_error","status_checked_at":"2026-01-13T14:35:19.697Z","response_time":56,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["craft","craft3","craftcms","craftcms-plugin"],"created_at":"2026-01-13T22:51:37.858Z","updated_at":"2026-01-13T22:51:38.563Z","avatar_url":"https://github.com/sjelfull.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003e**Note: This plugin has been abandoned as Craft 4 includes Collections support.**\n\n# Collections plugin for Craft CMS 3.x\n\nUse Laravel Collections in Craft\n\n![Screenshot](resources/img/icon.png)\n\n## Requirements\n\nThis plugin requires Craft CMS 3.0.0-beta.23 or later.\n\n## Installation\n\nTo install the plugin, follow these instructions.\n\n1. Open your terminal and go to your Craft project:\n\n        cd /path/to/project\n\n2. Then tell Composer to load the plugin:\n\n        composer require superbig/craft3-collections\n\n3. In the Control Panel, go to Settings → Plugins and click the “Install” button for Collections.\n\n## Collections Overview\n\nHere is some good inspiration on what you can do with Collections:\n\n- [Collections documentation](https://laravel.com/docs/5.5/collections)\n- [Laravel Collections: PHP Arrays On Steroids](https://scotch.io/tutorials/laravel-collections-php-arrays-on-steroids)\n- [Laravel Collections Examples on GitHub](https://github.com/fakiolinho/laravel-collections-examples)\n- [Laravel Collections “when” Method](https://laravel-news.com/laravel-collections-when-method)\n- [Code Bright: Eloquent Collections](https://daylerees.com/codebright-eloquent-collections/)\n- [Refactoring To Collection](https://adamwathan.me/refactoring-to-collections/)\n- [10 less-known (but awesome!) Laravel Collections methods](http://laraveldaily.com/10-less-known-but-awesome-laravel-collections-methods/)\n\n## Configuring Collections\n\nAdd your macros to the config file:\n\n```php\n\u003c?php\nreturn [\n\n    /** Add your macros here\n     * \"macros\" =\u003e [\n     *     'toUpper' =\u003e function () {\n     *         return $this-\u003emap(function ($value) {\n     *             return strtoupper($value);\n     *         });\n     *     },\n     * ],\n     *\n     */\n\n    \"macros\" =\u003e [\n\n    ],\n\n];\n\n```\n\n## Using Collections\n\n### Group tags by letter:\n\nAdd this macro to your config:\n\n```php\n\u003c?php\nreturn [\n    'macros' =\u003e [\n        'tagGroups' =\u003e function () {\n            return $this-\u003egroupBy(function ($tag) {\n                return substr($tag-\u003etitle, 0, 1);\n            });\n        }\n    ],\n];\n```\n\n```twig\n\u003c!DOCTYPE html\u003e\n\u003chtml lang=\"en\"\u003e\n\u003chead\u003e\n    \u003cmeta charset=\"UTF-8\"\u003e\n    \u003ctitle\u003eDocument\u003c/title\u003e\n    \u003clink rel=\"stylesheet\" href=\"https://cdnjs.cloudflare.com/ajax/libs/bulma/0.1.2/css/bulma.css\"\u003e\n\u003c/head\u003e\n\u003cbody\u003e\n\n\u003cdiv class=\"section hero is-primary\"\u003e\n    \u003cdiv class=\"hero-body\"\u003e\n        \u003cdiv class=\"container\"\u003e\n            \u003ch1 class=\"title\"\u003eTags\u003c/h1\u003e\n            \u003cp class=\"subtitle\"\u003e\n                Every tag on the site.\n            \u003c/p\u003e\n        \u003c/div\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\n\n\u003ch2\u003eTag groups\u003c/h2\u003e\n\n\u003cdiv class=\"section\"\u003e\n    \u003cdiv class=\"container\"\u003e\n        \u003cul class=\"has-columns has-text-centered\"\u003e\n            {% set collection = craft.tags.group('media') | collect %}\n            {% for letter, tags in collection.tagGroups() %}\n                \u003cdiv class=\"letter-group\"\u003e\n                    \u003ch3 class=\"title is-1 letter\"\u003e{{ letter }}\u003c/h3\u003e\n\n                    \u003cul\u003e\n                        {% for tag in tags %}\n                            \u003cli class=\"title is-5\"\u003e\n                                \u003ca href=\"/tags/{{ tag.slug }}\"\u003e{{ tag.title }}\u003c/a\u003e\n                            \u003c/li\u003e\n                        {% endfor %}\n                    \u003c/ul\u003e\n                \u003c/div\u003e\n            {% endfor %}\n        \u003c/ul\u003e\n    \u003c/div\u003e\n\u003c/div\u003e\n\n\u003c/body\u003e\n\u003c/html\u003e\n```\n\nBrought to you by [Superbig](https://superbig.co)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjelfull%2Fcraft3-collections","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsjelfull%2Fcraft3-collections","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsjelfull%2Fcraft3-collections/lists"}