PHPackages                             jeremyharris/cakephp-lazyload - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Framework](/categories/framework)
4. /
5. jeremyharris/cakephp-lazyload

ActiveCakephp-plugin[Framework](/categories/framework)

jeremyharris/cakephp-lazyload
=============================

An association lazy-loader for CakePHP

5.0.0(2y ago)61591.9k↓23.8%10[3 issues](https://github.com/jeremyharris/cakephp-lazyload/issues)[1 PRs](https://github.com/jeremyharris/cakephp-lazyload/pulls)2PHPPHP &gt;=8.1

Since Mar 14Pushed 2y ago7 watchersCompare

[ Source](https://github.com/jeremyharris/cakephp-lazyload)[ Packagist](https://packagist.org/packages/jeremyharris/cakephp-lazyload)[ RSS](/packages/jeremyharris-cakephp-lazyload/feed)WikiDiscussions master Synced 1mo ago

READMEChangelog (10)Dependencies (3)Versions (15)Used By (2)

[![Packagist](https://camo.githubusercontent.com/e9a88a9c978d434cb13951fb4180bdb43e5bb66dd8940a020d2dcda590e63998/68747470733a2f2f696d672e736869656c64732e696f2f7061636b61676973742f64742f6a6572656d796861727269732f63616b657068702d6c617a796c6f61642e737667)](https://packagist.org/packages/jeremyharris/cakephp-lazyload)![license](https://camo.githubusercontent.com/ab4177f6b7e8a4555750ba3f40332f37206a7a96a0f0cf64363e57651a2a6e83/68747470733a2f2f696d672e736869656c64732e696f2f6769746875622f6c6963656e73652f6a6572656d796861727269732f63616b657068702d6c617a796c6f61642e737667)

CakePHP ORM LazyLoad Plugin
===========================

[](#cakephp-orm-lazyload-plugin)

This is an association lazy loader for CakePHP ORM entities. It allows you to lazily load association data by accessessing the property, without using `contain()` (the eager loader).

Installation
------------

[](#installation)

Requirements

- CakePHP ORM (or the full framework) 5.x
- sloth

`$ composer require jeremyharris/cakephp-lazyload`

For older versions of the CakePHP ORM, look at older releases of this library.

Usage
-----

[](#usage)

If you have a base entity, add the trait to get lazy loading across all of your entities. Or, attach it to a single entity to only lazy load on that entity:

**src/Model/Entity/User.php**

```
