Skip to content

Instantly share code, notes, and snippets.

@tisuchi
Last active September 20, 2017 05:56
Show Gist options
  • Save tisuchi/5ff69f75da1d63ddfcc2a1408ed73861 to your computer and use it in GitHub Desktop.
Save tisuchi/5ff69f75da1d63ddfcc2a1408ed73861 to your computer and use it in GitHub Desktop.
Example of Laravel has() - tisuchi.com
<?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