Download the PHP package cviebrock/eloquent-log-lazy-loading without Composer

On this page you can find all versions of the php package cviebrock/eloquent-log-lazy-loading. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package eloquent-log-lazy-loading

Eloquent Log Lazy Loading

[!WARNING] This package is abandonned as it hasn't been updated since Laravel 5, and the functionality has been baked into recent versions of Laravel via the Model::handleLazyLoadingViolationUsing method.


Log (or disable) Eloquent lazy-loaded relationships in Laravel 5 to speed up your application.

Build Status Latest Stable Version Latest Unstable Version Scrutinizer Code Quality Total Downloads License


Why You Might Want This Package

Eloquent's lazy-loading is great. You can do Group::find($id) in your controller, and then loop through $group->users in your template without needing to worry about the database queries that run under-the-hood.

The problem comes when you try and loop through $group->users->addresses, or some other relation. You may inadvertently be running an SQL query for each iteration of that loop. If you are running a site that gets millions of hits a day, this might not be a good thing!

By logging where your script is lazy-loading relationships, you may be able to optimize your application to avoid unnecessary database calls. At the very least you can see where the bottlenecks are. And, if you want, you can disable lazy-loading entirely and only allow explicitly loaded relations from being accessed.

Installation

Install the package via composer:

That's it!

Usage

Your models should use the LogLazyLoading trait:

When you attempt to lazy load a relationship, the package will report a LazyLoadingException exception and continue normally (i.e. it will load the relationship). This is a great way to check where your application is doing lazy-loading and allows you to refactor, possibly reducing the number of database queries that are called.

However, if you really want to go hard core and halt your application when a relation is lazy-loaded, then just set the disableLazyLoading property on your model to true. The exception will be thrown, and not just reported.

Bugs, Suggestions and Contributions

Thanks to everyone who has contributed to this project.

Please use Github for reporting bugs, and making comments or suggestions.

See CONTRIBUTING.md for how to contribute changes.

Copyright and License

eloquent-taggable was written by Colin Viebrock and is released under the MIT License.

Copyright (c) 2017 Colin Viebrock


All versions of eloquent-log-lazy-loading with dependencies

PHP Build Version
Package Version
Requires php Version ^7.0
laravel/framework Version ~5.5.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package cviebrock/eloquent-log-lazy-loading contains the following files

Loading the files please wait ....