public static function activeClientCount(User $user, $bannerType = 0) { $banners = Banner::whereClientId($user->id)->whereIsActive(1); if ($bannerType > 0) { $banners->whereTypeId($bannerType); } return $banners->count(); }