Last active
September 20, 2017 05:56
-
-
Save tisuchi/5ff69f75da1d63ddfcc2a1408ed73861 to your computer and use it in GitHub Desktop.
Example of Laravel has() - tisuchi.com
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
$users = User::has('posts')->get(); | |
// only users that have at least one post are contained in the collection | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment