Get the App
SLTechnology News&Howtos  ›  Development  › 

How does Laravel query records through association

Shulou Source: shulou.com Published: 2022-06-01 04:38:32 10月01日 Update

Xiaobian to share with you how Laravel through the association query records, I believe most people do not know how, so share this article for your reference, I hope you have a lot of harvest after reading this article, let's go to understand it together!

Query records by association

In hasMany, you can query records whose association must be greater than 5.

$posts = Post::has ('comment ', '>', 5)->get(); The above is "Laravel how to record by association query" All the contents of this article, thank you for reading! I believe that everyone has a certain understanding, hope to share the content to help everyone, if you still want to learn more knowledge, welcome to pay attention to the industry information channel!

Tags: Relevance query article content not much most more knowledge industry information information channel channel reference learning help Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno vpn MariaDB Apple Shulou Technology Linux