Download the PHP package homedoctor-es/eloquent-has-by-non-dependent-subquery without Composer

On this page you can find all versions of the php package homedoctor-es/eloquent-has-by-non-dependent-subquery. 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-has-by-non-dependent-subquery

Eloquent Has By Non-dependent Subquery Build Status Coverage Status Scrutinizer Code Quality

Convert has() and whereHas() constraints to non-dependent subqueries.

NOTICE: Postgres' optimizer is very smart and covers JOIN optimization for dependent (correlated) subqueries. Therefore, this library is mainly targeted at MySQL which has a poor optimizer.

Requirements

Installing

Suggestion

You can install wimski/laravel-ide-helper-hook-eloquent-has-by-non-dependent-subquery to work with Laravel IDE Helper.

Motivation

Suppose you have the following relationship:

If you use has() constraints, your actual query would have dependent subqueries.

These subqueries may cause performance degradations. This package provides Illuminate\Database\Eloquent\Builder::hasByNonDependentSubquery() macro to solve this problem: you can easily transform dependent subqueries into non-dependent ones.

API

Signature

Arguments

$relationMethod

A relation method name that returns a Relation instance except MorphTo.

You can pass nested relations as an array or a string with dot-chain syntax.

$constraints

Additional callable constraints for relations that take Illuminate\Database\Eloquent\Relation as the first argument.

If you are using a union type as of PHP 8.0, the order of types does not matter.

The first closure corresponds to comments and the second one corresponds to author.

Feature Comparison

Feature mpyw/eloquent-has-by-join mpyw/eloquent-has-by-non-dependent-subquery
Minimum Laravel version 5.6 5.8
Argument of optional constraints Illuminate\Database\Eloquent\Builder Illuminate\Database\Eloquent\Relations\*
(Builder can be also accepted by specifying argument type)
Compoships support
No subqueries
(Performance depends on database optimizers)
No table collisions
(Sometimes you need to give aliases)
No column collisions
(Sometimes you need to use qualified column names)
OR conditions
Negative conditions
Counting conditions
HasOne
HasMany
BelongsTo
BelongsToMany
MorphOne
MorphMany
MorphTo
MorphMany
MorphToMany
HasOneThrough
HasManyThrough

All versions of eloquent-has-by-non-dependent-subquery with dependencies

PHP Build Version
Package Version
Requires php Version ^7.3 || ^8.0
illuminate/database Version ^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.0
illuminate/support Version ^5.8 || ^6.0 || ^7.0 || ^8.0 || ^9.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 homedoctor-es/eloquent-has-by-non-dependent-subquery contains the following files

Loading the files please wait ....