Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[6.x] Make newPivotQuery public #31677

Merged
merged 3 commits into from
Mar 2, 2020
Merged

[6.x] Make newPivotQuery public #31677

merged 3 commits into from
Mar 2, 2020

Conversation

krychu90
Copy link
Contributor

@krychu90 krychu90 commented Mar 2, 2020

This pull request makes newPivotQuery method as public. This is usefull for example: counting pivot table, getting information from pivot table etc. without querying related table.

Counting:

$post->comments()->newPivotQuery()->count();

Counting with condition:

$post->comments()->newPivotQuery()->whereIn('author_id', [1, 2])->count();

Checking if exists:

$post->comments()->newPivotQuery()->where('created_at', '>=', Carbon::now()->subDay()->toDateTimeString())->exists();

@driesvints driesvints changed the title Make newPivotQuery public [6.x] Make newPivotQuery public Mar 2, 2020
@taylorotwell taylorotwell merged commit 283bb24 into laravel:6.x Mar 2, 2020
voku added a commit to voku/framework that referenced this pull request Mar 2, 2020
* upstream/6.x: (21 commits)
  Revert "[6.x] migrate --seed should seed the same database (laravel#31678)" (laravel#31685)
  [6.x] Allow easier customization of the queued mailable job (laravel#31684)
  [6.x] migrate --seed should seed the same database (laravel#31678)
  [6.x] Make newPivotQuery public (laravel#31677)
  [6.x] update changelog
  Fix flakey memcached tests (laravel#31646)
  Fixed phpdoc
  formatting
  [6.x] Expose Notification Id within Message Data (laravel#31632)
  [6.x] Add support for Arr::hasAny (laravel#31636)
  Fix phpdoc
  [6.x] update changelog
  [6.x] update changelog
  Fix styling for phpdoc
  Create resolve method which loads deferred providers if needed
  Revert "Call make instead of resolve to load deffered providers"
  Call make instead of resolve to load deffered providers
  Add test that failes to load deffered provider of implementation while accessing class through interface
  Use correct locale when resolving Faker from the container (laravel#31615)
  clean-up-some-methods
  ...

# Conflicts:
#	src/Illuminate/Database/DatabaseServiceProvider.php
divine added a commit to divine/laravel-mongodb that referenced this pull request Mar 3, 2020
PR laravel/framework#31677 made newPivotQuery function public and that's the reason why builds are failing.
LukeTowers added a commit to octobercms/library that referenced this pull request Apr 4, 2020
softdevee added a commit to softdevee/laravel-mongodb that referenced this pull request Sep 5, 2022
PR laravel/framework#31677 made newPivotQuery function public and that's the reason why builds are failing.
lisadeloach63 added a commit to lisadeloach63/mongodb-laravel that referenced this pull request Oct 7, 2022
PR laravel/framework#31677 made newPivotQuery function public and that's the reason why builds are failing.
PermitinYury pushed a commit to PermitinYury/laravel-mongodb that referenced this pull request Feb 17, 2023
PR laravel/framework#31677 made newPivotQuery function public and that's the reason why builds are failing.
KarenEtheridg pushed a commit to KarenEtheridg/laravel-mongodb that referenced this pull request Feb 17, 2023
PR laravel/framework#31677 made newPivotQuery function public and that's the reason why builds are failing.
mnphpexpert added a commit to mnphpexpert/laravel-mongodb that referenced this pull request Sep 2, 2024
PR laravel/framework#31677 made newPivotQuery function public and that's the reason why builds are failing.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants