Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

laravel model withCount relationship condition

$model
  ->withCount('members')
  ->having('members_count', '>', 0)
  ->get();
Source by laracasts.com #
 
PREVIOUS NEXT
Tagged: #laravel #model #withCount #relationship #condition
ADD COMMENT
Topic
Name
9+8 =