Support the ongoing development of →
posted 7 years ago
Last updated 10 months ago.

Obviously, I don't know much of the background to the original poster's question, but to me, this looks like something better handled in a scope.

public function tasks() {
    return $this->hasMany('Tasks','startTarget')->orWhere('endTarget','=',$this->id);

public function scopeOpen($query) {
    return $query->where('status', '=', 0);

Then retrieval would look something like:

Last updated 7 years ago.

I am interested in this as well. Any updates?

Thank you


Sign in to participate in this thread!


Your banner here too?

0lide 0lide Joined 13 May 2014


We'd like to thank these amazing companies for supporting us

Your logo here?

The Laravel portal for problem solving, knowledge sharing and community building.

© 2023 - All rights reserved.