Level 75
What?! It's time to start learning...
1 like
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
I have multiple relationships and i want to select get the relationship data``` and compare it to the current date```` in my query.
Query
$workflow = Workflow::with('cropp', 'work.active')->whereDate('work.date', '>', Carbon::now())->get();
Workflow Model
public function work()
{
return $this->hasMany(Stage::class, 'workflow', 'id');
}
Stage Relationship
public function active()
{
return $this->hasOne(Activity::class, 'stages', 'id');
}
Please or to participate in this conversation.