{"id":21429391,"url":"https://github.com/nystudio107/eagerbeaver","last_synced_at":"2025-07-14T10:33:01.778Z","repository":{"id":57029559,"uuid":"105071302","full_name":"nystudio107/eagerbeaver","owner":"nystudio107","description":"DEPRECATED Allows you to eager load elements from auto-injected Entry elements on demand from your templates.","archived":false,"fork":false,"pushed_at":"2019-01-01T23:39:49.000Z","size":40,"stargazers_count":25,"open_issues_count":0,"forks_count":1,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-03-19T14:46:56.407Z","etag":null,"topics":["craft-plugin","craftcms","eager-loading","elements"],"latest_commit_sha":null,"homepage":"","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/nystudio107.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-27T21:28:41.000Z","updated_at":"2024-02-01T20:57:00.000Z","dependencies_parsed_at":"2022-08-23T17:40:52.277Z","dependency_job_id":null,"html_url":"https://github.com/nystudio107/eagerbeaver","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nystudio107%2Feagerbeaver","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nystudio107%2Feagerbeaver/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nystudio107%2Feagerbeaver/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nystudio107%2Feagerbeaver/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nystudio107","download_url":"https://codeload.github.com/nystudio107/eagerbeaver/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225970889,"owners_count":17553411,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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-plugin","craftcms","eager-loading","elements"],"created_at":"2024-11-22T22:17:37.192Z","updated_at":"2024-11-22T22:17:37.905Z","avatar_url":"https://github.com/nystudio107.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![No Maintenance Intended](http://unmaintained.tech/badge.svg)](http://unmaintained.tech/)\n\n# DEPRECATED\n\nThis Craft CMS 2.x plugin is no longer supported, but it is fully functional, and you may continue to use it as you see fit. The license also allows you to fork it and make changes as needed for legacy support reasons.\n\nThe Craft CMS 3.x version of this plugin can be found here: [craft-eagerbeaver](https://github.com/nystudio107/craft-eagerbeaver) and can also be installed via the Craft Plugin Store in the Craft CP.\n\n# Eager Beaver plugin for Craft CMS\n\nAllows you to eager load elements from auto-injected Entry elements on demand from your templates.\n\n![Screenshot](resources/screenshots/beaver.png)\n\nRelated: [Eager Beaver for Craft 3.x](https://github.com/nystudio107/craft3-eagerbeaver)\n\n## Installation\n\nTo install Eager Beaver, follow these steps:\n\n1. Download \u0026 unzip the file and place the `eagerbeaver` directory into your `craft/plugins` directory\n2.  -OR- do a `git clone https://github.com/nystudio107/eagerbeaver.git` directly into your `craft/plugins` folder.  You can then update it with `git pull`\n3.  -OR- install with Composer via `composer require nystudio107/eagerbeaver`\n4. Install plugin in the Craft Control Panel under Settings \u003e Plugins\n5. The plugin folder should be named `eagerbeaver` for Craft to see it.  GitHub recently started appending `-master` (the branch name) to the name of the folder for zip file downloads.\n\nEager Beaver works on Craft 2.6.x.\n\n## Eager Beaver Overview\n\nCraft's [Eager-Loading Elements](https://craftcms.com/docs/templating/eager-loading-elements) allows you to nicely optimize your templates by telling Craft to load everything you need in one big query.\n\nThe only rub is that you can't specify this eager loading behavior for `entry`, `category`, or `product` elements that are auto-injected into your template.\n\nEager Beaver is a small plugin that allows you to eager load sub-elements like Assets, Categories, Users, etc. to these auto-injected elements.\n\nThis is especially useful if you have pages that use Matrix block \"content builders\", and thus will typically result in loading a number of relations like Assets contained in Matrix blocks to render a page.\n\n## Configuring Eager Beaver\n\nThere's nothing to configure.\n\n## Using Eager Beaver\n\nTo use Eager Beaver, simply do something like:\n\n```\n{% do eagerLoadElements(entry, [\n    'author.userPicture',\n    'blogCategory',\n    'blogImage',\n    'blogContent.image:image'\n]) %}\n```\n\nOr you can use the more verbose syntax to do the same thing:\n\n```\n{% do craft.eagerBeaver.eagerLoadElements(entry, [\n    'author.userPicture',\n    'blogCategory',\n    'blogImage',\n    'blogContent',\n    'blogContent.image:image'\n]) %}\n```\n\nThe first parameter is the Element or array of Elements that you want to eager-load sub-elements into, such as an `entry`. If you pass in an array of Elements, they must all be the same type.\n\nThe second parameter is the same `with:` that you use for [Eager-Loading Elements](https://craftcms.com/docs/templating/eager-loading-elements), and uses the exact same syntax.\n\nIn the above example:\n - `author` is a `User` that has an Assets field named `userPicture` added to it.\n - `blogCategory` is a Category field\n - `blogImage` is an Asset field\n - `blogContent` is a Matrix field that has an Assets field named `image` added to the block type `image`\n\n## Eager Beaver Roadmap\n\nSome things to do, and ideas for potential features:\n\n* Release it\n\nBrought to you by [nystudio107](https://nystudio107.com/)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnystudio107%2Feagerbeaver","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnystudio107%2Feagerbeaver","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnystudio107%2Feagerbeaver/lists"}