Skip to content

Conversation

@utsavsomaiya
Copy link
Contributor

class Consumer extends Model { public function company(): BelongsTo { return $this->belongsTo(Company::class)->withTrashed(); } }
Consumer::query() - ->withWhereHas('company', function (Builder|BelongsTo $query): void { - $query->whereNull('deleted_at'); - }) + ->withWhereRelation('company', 'deleted_at' null);
@utsavsomaiya utsavsomaiya force-pushed the feature/add-withWhereRelation-method branch from ab068f5 to 2362ed4 Compare February 18, 2025 09:38
@taylorotwell taylorotwell merged commit d1b8c89 into laravel:11.x Feb 18, 2025
21 of 22 checks passed
@utsavsomaiya utsavsomaiya deleted the feature/add-withWhereRelation-method branch February 18, 2025 15:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

2 participants