Skip to content

Instantly share code, notes, and snippets.

@lukearmstrong
Created June 14, 2013 14:01
Show Gist options
  • Save lukearmstrong/5782028 to your computer and use it in GitHub Desktop.
Save lukearmstrong/5782028 to your computer and use it in GitHub Desktop.
Laravel 4 Pagination for a "Many to Many" relationship.
$company = \Company::find($companyId)
->with('users')
->first();
$users = $company->users()->paginate(10);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment