eloquent-has-by-join:将has()和whereHas()约束转换为单结果关系的join()约束

时间:2021-05-26 00:24:43
【文件属性】:
文件名称:eloquent-has-by-join:将has()和whereHas()约束转换为单结果关系的join()约束
文件大小:13KB
文件格式:ZIP
更新时间:2021-05-26 00:24:43
laravel performance eloquent join relationships 雄辩的加入 将has()和whereHas()约束转换为单结果关系的join()约束。 要求 PHP:^ 7.3 || ^ 8.0 Laravel:^ 6.0 || ^ 7.0 || ^ 8.0 正在安装 composer require mpyw/eloquent-has-by-join 动机 假设您具有以下关系: class Post extends Model { use SoftDeletes ; } class Comment extends Model { use SoftDeletes ; public function post (): BelongsTo { return $ this -> belongsTo ( Post ::class); } } 如果使用has()约束,则实际查询将具有从属子查询。
【文件预览】:
eloquent-has-by-join-master
----.php_cs(2KB)
----.gitignore(59B)
----_laravel_ide_helper.php(608B)
----src()
--------HasByJoinMacro.php(6KB)
--------EloquentHasByJoinServiceProvider.php(532B)
----.travis.yml(728B)
----LICENSE(1KB)
----composer.json(1KB)
----README.md(4KB)
----phpunit.xml(708B)
----.coveralls.yml(83B)
----tests()
--------Test.php(10KB)
--------Models()
----.scrutinizer.yml(421B)

网友评论