Get the App
SLTechnology News&Howtos  ›  Development  › 

How to query multiple records through ID by Laravel Eloquent

Shulou Source: shulou.com Published: 2022-06-01 04:35:28 10月03日 Update

Editor to share with you Laravel Eloquent how to query multiple records through ID, I believe most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Query multiple records through ID

Everyone knows the find () method, right?

$user = User::find (1)

I am surprised that few people know that this method can accept an array of multiple ID as parameters:

$users = User::find ([1pr 2je 3]); the above is all the contents of the article "how Laravel Eloquent queries multiple records through ID". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Tags: Multiple query article content method accident not much parameter multiple most owner array more knowledge industry information information channel channel reference learning Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Linux MariaDB MySQL Docker